Error building app ionic capacitor in appflow

286 Views Asked by At

When i building app ionic capacitor in appflow, i have this error. I updated packages through npm, I deleted the package-lock.json, updated the capacitor, the capacitor is in version 3, but still the error remains.

[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"
1

There are 1 best solutions below

0
On

I received the same error as my projects capacitor.config was a TS file. To fix it I changed the capacitor.config.ts to a json file.

Initial Configuration File (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;

Updated Configuration File (capacitor.config.json):

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

By using the JSON format for the capacitor.config file, the issue was resolved, and the project could be built successfully on AppFlow.