【发布时间】:2021-11-16 03:27:24
【问题描述】:
我正在尝试运行命令
ionic cordova platform add ios@6.2.0
一切都更新了,我的版本是:
ionic - 6.17.1
npm - 7.21.1
node - 16.9.1
pod - 1.11.2
我有 2 天前刚刚发布的 Xcode (13) 的最新版本。运行该命令时,我得到:
--save flag or autosave detected
Saving ios@~6.2.0 into config.xml file ...
Update IOS build setting SWIFT_OBJC_BRIDGING_HEADER to: "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h" for build configuration Debug
Update IOS build setting SWIFT_OBJC_BRIDGING_HEADER to: "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h" for build configuration Release
Update IOS build setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to: YES for build configuration Debug
Use Swift language version 5
Update IOS build setting SWIFT_OPTIMIZATION_LEVEL to: -Onone for build configuration Debug
Update IOS build setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to: YES for build configuration Release
Use Swift language version 5
[ERROR] An error occurred while running subprocess cordova.
cordova platform add ios@6.2.0 exited with exit code 1.
阅读我找到的每一篇文章后,我都将其包含在我的 config.xml 中:
<preference name="UseSwiftLanguageVersion" value="5" />
想我可能有一个不受支持的 Xcode 版本,我将 Xcode 降级到 v12.5.1,在 Xcode -> Preferences -> Locations 上选择它,然后重新启动所有终端和进程,重新启动 Mac,但仍然无法正常工作。
我尝试使用以下命令更新 CocoaPods:
pod install
pod setup
仍然没有任何效果,所以我决定运行命令
ionic cordova prepare ios
看看我是否可以继续但得到这个错误:
[error] Error: Cannot find module '@ionic/angular-toolkit/package.json'
Require stack:
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/index.js
- /usr/local/lib/node_modules/@angular/cli/models/architect-command.js
- /usr/local/lib/node_modules/@angular/cli/commands/run-impl.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/index.js
- /usr/local/lib/node_modules/@angular/cli/utilities/json-schema.js
- /usr/local/lib/node_modules/@angular/cli/models/command-runner.js
- /usr/local/lib/node_modules/@angular/cli/lib/cli/index.js
- /usr/local/lib/node_modules/@angular/cli/lib/init.js
- /usr/local/lib/node_modules/@angular/cli/bin/ng
是的,如果您想知道每次我更新或运行命令时,我也删除了平台、插件、node_modules 和 www 文件夹,但任何事情都在发生。
【问题讨论】:
标签: ios swift iphone xcode ionic-framework