构建flutter项目时,体系结构x86_64的未定义符号

gpfsuwkq  于 2023-05-23  发布在  Flutter
关注(0)|答案(2)|浏览(256)

我正在尝试从Xcode版本12.4构建一个flutter项目,用于iOS 14.4的iPhone 12模拟器。通过运行flutter run命令行,一切都可以正常运行。
在Xcode中,我遇到了以下错误代码。

ld: warning: ignoring file /Users/epsilon/Library/Developer/Xcode/DerivedData/Runner-fukggautraualohaflrpmsjaeyto/Build/Products/Debug-iphonesimulator/Reachability/Reachability.framework/Reachability, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Reachability", referenced from:
      objc-class-ref in FLTConnectivityPlugin.o
  "_kReachabilityChangedNotification", referenced from:
      -[FLTConnectivityPlugin onListenWithArguments:eventSink:] in FLTConnectivityPlugin.o
ld: symbol(s) not found for architecture x86_64

我已经遵循了这里发布的解决方案:https://stackoverflow.com/a/63955114/8640235和其他来自同一帖子的人,但没有成功。
后期编辑:

fv2wmkja

fv2wmkja1#

使用flutter create创建新项目,并将代码迁移到新项目中。

ujv3wf0j

ujv3wf0j2#

我也面临着同样的问题。从flutter项目中删除connectivity包后,模拟器再次按预期工作。

相关问题