带有cordova的Appflow在构建中检测电容器
Posted
技术标签:
【中文标题】带有cordova的Appflow在构建中检测电容器【英文标题】:Appflow with cordova detects capacitor instead in build 【发布时间】:2021-11-11 13:20:51 【问题描述】:我有一个项目曾经使用capacitor
,但现在只使用cordova
。
在我的Ionic Dashboard
中将其版本化为Commit
后,我尝试从该Commit
创建一个Build
并收到此错误
[13:57:35]: --------------------------------
[13:57:35]: --- Step: detect_native_type ---
[13:57:35]: --------------------------------
[13:57:35]: Checking if cordova or capacitor project
[13:57:35]: Capacitor project with TS/JS config detected
[13:57:35]: --------------------------------
[13:57:35]: --- Step: dependency_install ---
[13:57:35]: --------------------------------
[13:57:35]: Installing Dependencies
[13:57:35]: $ npm ci --quiet --no-optional
[13:58:03]: ▸ > core-js@3.17.3 postinstall /builds/project-0/node_modules/core-js
[13:58:03]: ▸ > node -e "tryrequire('./postinstall')catch(e)"
[13:58:04]: ▸ > core-js@3.6.4 postinstall /builds/project-0/node_modules/@angular-devkit/build-angular/node_modules/core-js
[13:58:04]: ▸ > node -e "tryrequire('./postinstall')catch(e)"
[13:58:04]: ▸ > sharp@0.25.4 install /builds/project-0/node_modules/sharp
[13:58:04]: ▸ > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
[13:58:04]: ▸ info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
[13:58:06]: ▸ > @angular/cli@9.1.15 postinstall /builds/project-0/node_modules/@angular/cli
[13:58:06]: ▸ > node ./bin/postinstall/script.js
[13:58:07]: ▸ added 2108 packages in 31.198s
[13:58:07]: -------------------------------------
[13:58:07]: --- Step: create_capacitor_config ---
[13:58:07]: -------------------------------------
[13:58:09]: -------------------------
[13:58:09]: --- Step: upload_logs ---
[13:58:09]: -------------------------
[13:58:17]: Unable to upload npm package list log. Skipping.
+------------------+-----------------------+
| Lane Context |
+------------------+-----------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | android |
| LANE_NAME | android package_build |
+------------------+-----------------------+
[13:58:20]: Capacitor config command failed, ensure capacitor dependency has been updated to version 3 or more
+------+-------------------------+-------------+
| fastlane summary |
+------+-------------------------+-------------+
| Step | Action | Time (in s) |
+------+-------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | build_summary | 0 |
| 3 | add_git_credentials | 0 |
| 4 | get_appflow_config | 0 |
| 5 | detect_native_type | 0 |
| 6 | dependency_install | 31 |
| ???? | create_capacitor_config | 2 |
| 8 | upload_logs | 11 |
+------+-------------------------+-------------+
[13:58:20]: 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/project-0/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>'
让这个错误如此奇怪的是,我的项目中已经删除了每次提到“capacitor
”,包括capacitor.config.json
文件。
我的ionic.config.json
设置如下所示
"integrations":
"cordova":
,
最重要的是,我删除了package-lock.json
和/node_modules
并重新安装,然后我ionic cordova platform add/remove
ios & android 然后1ionic cordova prepare` ios & android。
我仍然收到此错误。
谁能帮我在ionic dashboard
Build
进程中移除电容器
【问题讨论】:
【参考方案1】:这是 Ionic 的一个已知问题,解决方案是联系 Ionic 并让他们正确地将帐户切换到电容器或 cordova。解决方案 2 是您需要使用 cordova 或电容器在 ionic 上创建一个新项目,然后将您的项目克隆到它。
【讨论】:
以上是关于带有cordova的Appflow在构建中检测电容器的主要内容,如果未能解决你的问题,请参考以下文章
Cordova:无论如何,是不是可以在 Javascript 中检测 iOS 应用程序是作为调试版还是作为发布版构建的?
定义架构特定的cordova插件库以在电容器/反应项目中使用
cordova windows 构建错误(未检测到所选目标的有效 MSBuild) - 检查所有 Cordova 要求
Cordova 构建 android 失败!!! JDK 8('1.8.*')的要求检查失败!检测到的版本:9.0.1 在 Windows 10 中