链接器命令失败,退出代码为 1(使用 -v 查看调用)(armv7)xcode

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12671712/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 15:50:44  来源:igfitidea点击:

linker command failed with exit code 1 (use -v to see invocation) (armv7) xcode

xcodexcode4barcode-scannerarmv7

提问by Dujard

I tried to compile my xcode project (i use xcode 4.5) and i have installed cordova 1,5 and the plugin BarecodeScanner on my project.

我试图编译我的 xcode 项目(我使用 xcode 4.5)并且我已经在我的项目中安装了cordova 1,5 和插件 BarecodeScanner。

When i try to compile on iOs 6 ipod devices, i have the following error :

当我尝试在 iOs 6 ipod 设备上编译时,出现以下错误:

Ld "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4" normal armv7s
    cd /Users/username/Sites/iOS/codebarre4
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk "-L/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Products/Ad Hoc Distribution-iphoneos" "-F/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Products/Ad Hoc Distribution-iphoneos" -F/Users/Shared/Cordova/Frameworks -filelist "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4.LinkFileList" -dead_strip -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak_library /usr/lib/libSystem.B.dylib -fobjc-link-runtime -miphoneos-version-min=6.0 -weak-liconv -weak_framework CoreVideo -weak_framework AssetsLibrary -weak_framework AVFoundation -framework Foundation -framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -framework CoreLocation -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -framework CoreMedia -framework Cordova -o "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4"

ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/Shared/Cordova/Frameworks/Cordova.framework/Cordova for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This error message is very complicated to understand... i searched on the web but found anything... Have you got any idea of the origin of this message ?

这个错误信息很难理解...我在网上搜索但发现了什么...你知道这个信息的来源吗?

Thanks a lot,

非常感谢,

回答by Daniel Tome

What worked for me, was to set "Enable Bitcode" to "No" in the Build Settings > Build options.

对我有用的是在“构建设置”>“构建选项”中将“启用位码”设置为“否”。

Use the search on the top: http://screencast.com/t/xSCnqHGkhh

使用顶部的搜索:http: //screencast.com/t/xSCnqHGkhh

The error I was getting was:

我得到的错误是:

XXX does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

XXX 不包含位码。您必须在启用位码的情况下重建它(Xcode 设置 ENABLE_BITCODE),从供应商处获取更新的库,或为此目标禁用位码。用于架构 arm64

回答by Sanjin Haracic

Your project may be configured to target armv7 which is hindering the linker.

您的项目可能被配置为以 armv7 为目标,这会阻碍链接器。

  1. Select your project
  2. Go to info tab
  3. Remove Required Device Capability item if existing (may be armv7 called)
  1. 选择您的项目
  2. 转到信息选项卡
  3. 删除必需的设备功能项(如果存在)(可能是 armv7 调用)

回答by jetfire

I was getting the same error as well.

我也遇到了同样的错误。

I resolved the issue on my end by using the following steps:

我通过使用以下步骤解决了这个问题:

  1. Going to the Build Settingsfor the Project.
  2. Under the Settings> Valid Architecture settings, I had the values for Debug set to armv7and armv7s. And I had the values for Release set to armv7and armv7s.
  3. I realized that the armv7sitems were causing the problem. So I removed armv7sfrom both entries.
  1. 前往Build Settings项目。
  2. Settings> 下Valid Architecture settings,我将 Debug 的值设置为armv7armv7s。我将 Release 的值设置为armv7armv7s
  3. 我意识到是这些armv7s项目导致了问题。所以我armv7s从两个条目中删除。

After that, I was able to archive my project with no issues.

在那之后,我能够毫无问题地存档我的项目。

回答by A_Thorne

You might not have included any framework in your project. Go to

您的项目中可能没有包含任何框架。去

Project > targets > build phases > link binary with libraries

项目 > 目标 > 构建阶段 > 将二进制文件与库链接

and add your missing framework.

并添加您缺少的框架。

回答by Jay Imerman

Also see this Question.

另请参阅此问题

  1. Make sure your Build Settings "Architectures" setting includes the target architecture (the processor chip) - armv7 for iOS 6, armv7s for iOS 7, etc.
  2. If you have any third party libraries you link in, make sure they are built with the proper architecture support. Otherwise rebuild those libraries or check the developer for update downloads.
  3. Finally, reopen the project with updated libraries, Clean, and Build.
  4. You may also want to verify you have an up-to-date XCode with the right iOS supporting environments.
  1. 确保您的构建设置“架构”设置包括目标架构(处理器芯片) - 用于 iOS 6 的 armv7、用于 iOS 7 的 armv7s 等。
  2. 如果您链接了任何第三方库,请确保它们是使用适当的架构支持构建的。否则重建这些库或检查开发人员的更新下载。
  3. 最后,使用更新的库、清理和构建重新打开项目。
  4. 您可能还想验证您是否拥有具有正确 iOS 支持环境的最新 XCode。