尝试使用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)
答案 0 :(得分:10)
Xcode错误linker command failed with exit code 1 (use -v to see invocation)
让我感到this stack overflow answer
第二个答案建议在Xcode项目中检查多个/重复的.m文件编译资源:
如果在“构建阶段”中目标的“编译源”部分中多次引用相同的.m文件,则会发生这种情况。删除重复的条目,你应该没事。
所以我在Xcode中进行了检查,确实有一个对插件资源的重复调用。
检查package.json后,我发现以两种方式引用了相同的插件(有两条路径)。
删除两个插件中的一个解决了这个问题。
答案 1 :(得分: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
答案 2 :(得分:0)
我的案子的解决方法很简单
cd platforms/ios
然后:
pod install