这个问题快把我逼疯了,我不知道怎么解决它。

    Undefined symbols for architecture armv7:
  "_deflateEnd", referenced from:
      -[ASIDataCompressor closeStream] in ASIDataCompressor.o
  "_OBJC_CLASS_$_ASIDataDecompressor", referenced from:
      objc-class-ref in ASIHTTPRequest.o
  "_deflate", referenced from:
      -[ASIDataCompressor compressBytes:length:error:shouldFinish:] in ASIDataCompressor.o
  "_deflateInit2_", referenced from:
      -[ASIDataCompressor setupStream] in ASIDataCompressor.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

我认为这与:

ld: symbol(s) not found for architecture armv7

但是我添加了:libz.1.2.3。Dylib并没有帮助,有人有什么想法吗?


当前回答

如果您在释放模式下构建您的Flutter项目时遇到了这个问题-这对我有帮助:

Set your build system to New Build System in File > Project Settings… delete folders ios and build_ios from your project folder. create ios module by executing flutter create . from your project folder. open Xcode and: set the IOS Deployment Target to at least 9.0 in PROJECT > Runner check your Signing & Capabilities make sure your Build Configuration is set to Release in Edit Scheme... and build for Generic iOS Device execute pod install from your project folder execute flutter pub get from your project folder

现在打开你的Xcode并构建或存档它:Product > build(或archive)

其他回答

我曾经遇到过这个问题。我意识到在移动一个类时,我已经在目标文件夹上用.h文件覆盖了.mm文件。

修复这个问题就修复了错误。

在我的例子中,当我在源代码控制下创建一个新分支时,我遇到了类似的问题。

我可以通过简单地执行产品>清洁来解决这个问题

Go TARGETS -> General -> Deployment Info ->设置目标8.1或10.0

框架或库没有ARMV7体系结构。

我在安装shareKit时遇到了这个问题。它可以在模拟器中运行,但不能在设备上运行。我从其他链接器标志中删除了-all_load,一切都在模拟器和iphone设备中正常工作。

尝试实现派生类的至少一个非内联函数。如果不这样做,链接器可能会避免为该类创建类型信息。