离子应用程序构建失败,错误"链接器命令失败,退出代码为1(使用-v查看调用)"

Har*_*y B 5 xcode ios cordova ionic

尝试构建使用时,ionic run ios -lc我在终端中看到以下错误:

** BUILD FAILED **


The following build commands failed:
    Ld build/emulator/xXxXxXx.app/xXxXxXx normal i386
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/xXxXxXx/Projects/xXxXxXx/platforms/ios/cordova/build-debug.xcconfig,-project,xXxXxXx.xcodeproj,ARCHS=i386,-target,xXxXxXx,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/xXxXxXx/Projects/xXxXxXx/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/xXxXxXx/Projects/xXxXxXx/platforms/ios/build/sharedpch
Error: /Users/xXxXxXx/Projects/xXxXxXx/platforms/ios/cordova/run: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Run Code Online (Sandbox Code Playgroud)

当我尝试在xCode中构建相同的应用程序时,我看到了错误 linker command failed with exit code 1 (use -v to see invocation)

  • 我删除并添加了ios平台
  • 我已经更新了ios-deploy
  • 我已经更新了ios-sim
  • 我重新启动了Xcode
  • 我重启了我的机器Xcode是最新的
  • 我可以成功建立其他项目

Har*_*y B 10

Xcode错误linker command failed with exit code 1 (use -v to see invocation)导致我的堆栈溢出答案

第二个答案建议在Xcode项目中检查多个/重复的.m文件编译资源:

如果在"构建阶段"中目标的"编译源"部分中多次引用相同的.m文件,则会发生这种情况.删除重复的条目,你应该没事.

所以我在Xcode中检查了一下,确实有一个对插件资源的重复调用.

检查package.json后,我发现同一个插件以两种方式引用(有两个路径).

删除两个插件中的一个解决了这个问题.

  • 对我来说,它是离子键盘.我有两个不同名称空间的键盘插件.检查您的插件并删除不需要的 (2认同)

小智 9

我在github上找到了解决方案

the solution for me was open the .xcworkspace file insted of .xcodeproj located inside my '/platforms/ios' folder.

https://github.com/phonegap/phonegap-plugin-push/issues/1240