【问题标题】:Cannot build release app - Undefined symbols for architecture armv7无法构建发布应用程序 - 架构 armv7 的未定义符号
【发布时间】:2020-03-07 10:58:15
【问题描述】:

我正在使用 Flutter 在 iOS (Xcode) 上构建应用程序。调试构建运行良好,但是当我构建发布时,我收到错误。

ld: warning: ignoring file /Users/mac/Library/Developer/Xcode/DerivedData/Runner-goymfovmnvitvmgsgblaexbdslkp/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/stripe_native/stripe_native.framework/stripe_native, building for iOS-armv7 but attempting to link with file built for iOS-arm64
Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_StripeNativePlugin", referenced from:
      objc-class-ref in GeneratedPluginRegistrant.o
ld: symbol(s) not found for architecture armv7

我环顾四周,尝试将 Build Active Architecture Only 设置为 NoLink Binary to Libraries - 似乎没有任何效果。

在这种情况下我该怎么办?

【问题讨论】:

    标签: ios xcode flutter build architecture


    【解决方案1】:

    根本问题是 iOS 11 已放弃对 armv7 架构的支持,并且您的部署目标之一可能设置为 = 11.0 或未设置。目标小于11.0时编译armv7,目标>=11.0或未设置armv7时不编译。

    我的问题是我的应用程序的部署目标设置为 iOS 10,但我的 Pod 的目标没有设置(因此为最新的 iOS 13 构建)。对于这种特殊情况,它适用于 UIDeviceIdentifier 目标。错误是:

    Undefined symbols for architecture armv7: "_OBJC_CLASS_$_UIDeviceHardware", referenced from: objc-class-ref in .... ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    在这种特殊情况下,我只是在更新我的 pod,因此必须清除 pod 的设置。在 Build Settings 选项卡下的 Pod 目标设置中,我将 iOS 部署目标设置为 10.0(与应用程序相同)并且它工作正常。

    作为替代方案,我可以将应用的部署目标设置为 11.0。

    【讨论】:

      猜你喜欢
      • 2016-04-29
      • 2011-09-19
      • 1970-01-01
      • 2014-10-23
      • 2013-03-16
      • 2012-06-11
      • 1970-01-01
      相关资源
      最近更新 更多