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

问题描述 投票:5回答:3

当尝试使用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是最新的
  • 我可以成功建立其他项目
ios xcode cordova ionic
3个回答
10
投票

Xcode错误linker command failed with exit code 1 (use -v to see invocation)让我去了this stack overflow answer

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

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

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

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

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


8
投票

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


0
投票

我案子的解决方案很简单

cd platforms/ios

然后:

pod install
© www.soinside.com 2019 - 2024. All rights reserved.