繁体   English   中英

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

[英]ionic app build fails with error 'linker command failed with exit code 1 (use -v to see invocation)'

当尝试使用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)

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

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

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

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

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

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

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

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

我在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

我案子的解决方案很简单

cd platforms/ios

然后:

pod install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM