【问题标题】:linker command failed with exit code 1 (use -v to see invocation) (armv7) xcode链接器命令失败,退出代码为 1(使用 -v 查看调用)(armv7)xcode
【发布时间】:2023-03-28 16:23:01
【问题描述】:

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

当我尝试在 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)

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

非常感谢,

【问题讨论】:

    标签: xcode xcode4 barcode-scanner armv7


    【解决方案1】:

    对我有用的是在 Build Settings > Build options 中将“Enable Bitcode”设置为“No”。

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

    我得到的错误是:

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

    【讨论】:

      【解决方案2】:

      您的项目可能配置为针对阻碍链接器的 armv7。

      1. 选择您的项目
      2. 转到信息标签
      3. 如果存在,则删除所需的设备能力项(可能称为 armv7)

      【讨论】:

      • 稍后我会再挖掘一些,如果我发现任何东西,我会回复这里
      【解决方案3】:

      我也遇到了同样的错误。

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

      1. 转到Build Settings 获取项目。
      2. 在Settings > Valid Architecture settings 下,我将Debug 的值设置为armv7 和armv7s。我将 Release 的值设置为 armv7 和 armv7s。
      3. 我意识到armv7s 项目导致了问题。所以我从两个条目中删除了armv7s。

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

      【讨论】:

      • 这最终会让您的应用在所有以前支持的设备上运行吗?
      【解决方案4】:

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

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

      并添加您缺少的框架。

      【讨论】:

        【解决方案5】:

        另见this Question。

        1. 确保您的构建设置“架构”设置包括目标架构(处理器芯片) - 适用于 iOS 6 的 armv7、适用于 iOS 7 的 armv7s 等。
        2. 如果您链接了任何第三方库,请确保它们是在适当的体系结构支持下构建的。否则重建这些库或检查开发人员是否有更新下载。
        3. 最后,使用更新的库、Clean 和 Build 重新打开项目。
        4. 您可能还想验证您是否拥有最新的 XCode 以及正确的 iOS 支持环境。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2023-03-03
          • 1970-01-01
          • 2018-08-23
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多