升级到 xCode 15.1 后,我不再能够从 intellij 或命令行(flutter run)编译我的 flutter 项目,但从 xcode 它可以工作

After upgrading to xCode 15.1 i'm no longer able to compile my flutter project from intellij or command line (flutter run) but from xcode it works

提问人:Bogghi 提问时间:11/7/2023 更新时间:11/7/2023 访问量:67

问:

最近我将 xCode 升级到 15.1,自从这次升级以来,我无法从 intellij 和命令行编译,启动 .如果我尝试直接从 xCode 编译应用程序,它编译得很好。flutter run

这是我尝试从 intellij 启动时遇到的错误:

Launching lib/main.dart on IT-DMPYH4CXLMT7 in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: *******
Running Xcode build...
Xcode build done.                                           56,3s
Failed to build iOS app
Could not build the precompiled application for the device.
Error (Xcode): Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility56


Error launching application on IT-DMPYH4CXLMT7.

我试图读取 xcode 中的堆栈跟踪以了解正在做什么以达到临界点,我发现了这一点:


ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/matteo/src/apprm_nca/build/ios/Debug-iphoneos/awesome_notifications_fcm/Flutter.framework/Flutter
ld: warning: Could not find or use auto-linked library 'swiftCompatibilityPacks'
ld: warning: Could not find or use auto-linked library 'swiftCompatibility56'
ld: warning: Could not find or use auto-linked library 'swiftObservation'
ld: warning: Could not find or use auto-linked framework 'Symbols'
Undefined symbols for architecture arm64:
  "__swift_FORCE_LOAD_$_swiftCompatibility56", referenced from:
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_IosAwnFcmCore in IosAwnFcmCore(AwesomeServiceExtension.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_IosAwnFcmCore in IosAwnFcmCore(AwesomeFcmEventsReceiver.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_IosAwnFcmCore in IosAwnFcmCore(AwesomeFcmListener.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_IosAwnFcmCore in IosAwnFcmCore(AwesomeFcmService.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_IosAwnFcmCore in IosAwnFcmCore(Crypto.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_IosAwnFcmCore in IosAwnFcmCore(FcmBackgroundExecutor.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_IosAwnFcmCore in IosAwnFcmCore(FcmBackgroundService.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility56_$_IosAwnFcmCore)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Linking against a dylib which is not safe for use in application extensions: /Users/matteo/src/apprm_nca/build/ios/Debug-iphoneos/awesome_notifications_fcm/Flutter.framework/Flutter

Could not find or use auto-linked library 'swiftCompatibilityPacks'

Could not find or use auto-linked library 'swiftCompatibility56'

Could not find or use auto-linked library 'swiftObservation'

Could not find or use auto-linked framework 'Symbols'

Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility56



Build failed    06/11/23, 12:15    29.4 seconds

搜索它看起来像是 swift 库之间的一些桥接问题,但我不熟悉这种情况,所以我可能走错了路。

不知道如何处理,我尝试了最后一次尝试,删除 xcode 和项目本身并重新安装。没什么,还是同样的错误。

我希望我为这个问题留下了足够的细节!

更改 xcode 中的各种选项,删除并重新安装 xcode,flutter clean,cocoapods 重置

iOS Flutter Xcode Xcode15

评论

0赞 Bashir 11/28/2023
有同样的问题,有什么解决方案吗?
0赞 Bogghi 11/28/2023
@Bashir我是 OP,唯一能为我解决问题的解决方案是安装 clenamymac 并重新安装 xcode afeter 清除 xcode 留下的每一点狗屎。重新安装后,它又开始工作了。

答: 暂无答案