ios - ionic 应用程序构建失败,错误为 'linker command failed with exit code 1 (use -v to see invocation)'

标签 ios xcode cordova ionic-framework

尝试使用 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 错误 链接器命令失败,退出代码为 1(使用 -v 查看调用) 导致我 this stack overflow answer

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

That can happen if the same .m file is referenced multiple times in your target's "Compile Sources" section in "Build Phases". Remove duplicate entries and you should be fine.

所以我在 Xcode 中进行了检查,确实存在对插件资源的重复调用。

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

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

关于ios - ionic 应用程序构建失败,错误为 'linker command failed with exit code 1 (use -v to see invocation)',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30528762/

相关文章:

iphone - 如何使表格 View 单元格作为按钮工作?

android - 通过 logcat 在 Android 上调试 WebView (Ionic) 应用程序

iOS - 找不到右侧的配置门户选项卡

ios - 设备旋转后调用 invalidateLayout() 或 reloadData() 重新加载从 Storyboard 创建的 UICollectionView

ios - 使用 Moya 获取响应头

ios - 尝试使用 pushmote sdk 时找不到“PushmoteSDK/Headers/Pushmote.h”文件

java - 如何将 PhoneGap 集成到 Ant 构建中?

javascript - PhoneGap 中的登录页面

ios - PhoneGap 缺少 plist.key

javascript - 在 ios 或 android 中使用 safari 或 chrome 播放 mp3 文件