Ionic 在appflow中构建应用程序离子电容器时出错

zynd9foi  于 12个月前  发布在  Ionic
关注(0)|答案(1)|浏览(148)

当我在appflow中构建应用程序离子电容器时,我有这个错误。我通过npm更新了包,我删除了package-lock.json,更新了电容器,电容器是版本3,但仍然存在错误。

[18:58:02]: fastlane finished with errors
/usr/local/bundle/bin/fastlane: [!] Capacitor config command failed, ensure capacitor dependency has been updated to version 3 or more (RuntimeError)
/usr/local/bundle/gems/fastlane-2.179.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': Shell command exited with exit status 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/helper/sh_helper.rb:12:in `sh'
    from /builds/NathanAllmeida/apvs-associate/fastlane/actions/create_capacitor_config.rb:13:in `run'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
    from Fastfile:162:in `block (2 levels) in parsing_binding'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/lane.rb:33:in `call'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
    from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
    from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
    from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
    from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
    from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
    from /usr/local/bundle/gems/fastlane-2.179.0/bin/fastlane:23:in `<top (required)>'
    from /usr/local/bundle/bin/fastlane:23:in `load'
    from /usr/local/bundle/bin/fastlane:23:in `<main>'
Running after script...
$ run "clean-up"
u59ebvdq

u59ebvdq1#

我收到了同样的错误,因为我的项目电容器.config是一个TS文件.为了解决这个问题,我将capacitor.config.ts改为json文件。
初始配置文件(capacitor.config.ts):

import { CapacitorConfig } from '@capacitor/cli';   

const config: CapacitorConfig = {   
  appId: 'com.blah.blahhh', 
  appName: 'blahh', 
  webDir: '../../dist/apps/blahh',  
  bundledWebRuntime: false, 
};  

export default config;

更新配置文件(capacitor.json):

{
  "appId": "com.blah.blahhh",
  "appName": "blahh",
  "webDir": "../../dist/apps/blahh",
  "bundledWebRuntime": false
}

通过对capacitor.config文件使用JSON格式,问题得到了解决,并且可以在AppFlow上成功构建项目。

相关问题