Flutter:架构 arm64 的未定义符号
Flutter: Undefined symbols for architecture arm64
迁移到 null-safety 和 flutter 2 后,我遇到了 ios build 的问题:
我运行flutter clean; rm ios/Podfile.lock pubspec.lock; rm -rf ios/Pods ios/Runner.xcworkspace; flutter run --flavor dev -t lib/main_dev.dart
得到这个 logcat:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FlutterStandardTypedData", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_FlutterStandardMessageCodec", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_FlutterError", referenced from:
objc-class-ref in firebase_core(FLTFirebasePlugin.o)
objc-class-ref in google_maps_flutter(FLTGoogleMapsPlugin.o)
objc-class-ref in google_maps_flutter(FLTGoogleMapTileOverlayController.o)
objc-class-ref in google_maps_flutter(GoogleMapMarkerController.o)
objc-class-ref in google_maps_flutter(GoogleMapController.o)
objc-class-ref in onesignal_flutter(OSFlutterCategories.o)
"_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
objc-class-ref in firebase_core(FLTFirebaseCorePlugin.o)
objc-class-ref in firebase_crashlytics(FLTFirebaseCrashlyticsPlugin.o)
objc-class-ref in google_maps_flutter(GoogleMapController.o)
objc-class-ref in onesignal_flutter(OSFlutterOutcomeEventsController.o)
objc-class-ref in onesignal_flutter(OneSignalPlugin.o)
objc-class-ref in onesignal_flutter(OSFlutterTagsController.o)
objc-class-ref in onesignal_flutter(OSFlutterInAppMessagesController.o)
...
"_FlutterMethodNotImplemented", referenced from:
-[FLTFirebaseCorePlugin handleMethodCall:result:] in firebase_core(FLTFirebaseCorePlugin.o)
-[FLTFirebaseCrashlyticsPlugin handleMethodCall:result:] in firebase_crashlytics(FLTFirebaseCrashlyticsPlugin.o)
___61-[FLTTileProviderController requestTileForX:y:zoom:receiver:]_block_invoke in google_maps_flutter(FLTGoogleMapTileOverlayController.o)
-[FLTGoogleMapController onMethodCall:result:] in google_maps_flutter(GoogleMapController.o)
-[OSFlutterOutcomeEventsController handleMethodCall:result:] in onesignal_flutter(OSFlutterOutcomeEventsController.o)
-[OneSignalPlugin handleMethodCall:result:] in onesignal_flutter(OneSignalPlugin.o)
-[OSFlutterTagsController handleMethodCall:result:] in onesignal_flutter(OSFlutterTagsController.o)
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我尝试过但没有帮助:
pod deintegrate && rm Podfile.lock && pod install --repo-update
- 在 Podfile
中设置 platform :ios, '12.0'
- 在构建设置中手动设置架构为
arm64
这个问题我在两个 flutter 项目中遇到过,但我不知道如何解决。
更新:
看起来像是 OneSignal https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/389
的问题
UPD2:
有问题的示例项目 https://github.com/rovkinmax/OneSignalSDKProblem
迁移到 null-safety 和 flutter 2 后,我遇到了 ios build 的问题:
我运行flutter clean; rm ios/Podfile.lock pubspec.lock; rm -rf ios/Pods ios/Runner.xcworkspace; flutter run --flavor dev -t lib/main_dev.dart
得到这个 logcat:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FlutterStandardTypedData", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_FlutterStandardMessageCodec", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_FlutterError", referenced from:
objc-class-ref in firebase_core(FLTFirebasePlugin.o)
objc-class-ref in google_maps_flutter(FLTGoogleMapsPlugin.o)
objc-class-ref in google_maps_flutter(FLTGoogleMapTileOverlayController.o)
objc-class-ref in google_maps_flutter(GoogleMapMarkerController.o)
objc-class-ref in google_maps_flutter(GoogleMapController.o)
objc-class-ref in onesignal_flutter(OSFlutterCategories.o)
"_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
objc-class-ref in firebase_core(FLTFirebaseCorePlugin.o)
objc-class-ref in firebase_crashlytics(FLTFirebaseCrashlyticsPlugin.o)
objc-class-ref in google_maps_flutter(GoogleMapController.o)
objc-class-ref in onesignal_flutter(OSFlutterOutcomeEventsController.o)
objc-class-ref in onesignal_flutter(OneSignalPlugin.o)
objc-class-ref in onesignal_flutter(OSFlutterTagsController.o)
objc-class-ref in onesignal_flutter(OSFlutterInAppMessagesController.o)
...
"_FlutterMethodNotImplemented", referenced from:
-[FLTFirebaseCorePlugin handleMethodCall:result:] in firebase_core(FLTFirebaseCorePlugin.o)
-[FLTFirebaseCrashlyticsPlugin handleMethodCall:result:] in firebase_crashlytics(FLTFirebaseCrashlyticsPlugin.o)
___61-[FLTTileProviderController requestTileForX:y:zoom:receiver:]_block_invoke in google_maps_flutter(FLTGoogleMapTileOverlayController.o)
-[FLTGoogleMapController onMethodCall:result:] in google_maps_flutter(GoogleMapController.o)
-[OSFlutterOutcomeEventsController handleMethodCall:result:] in onesignal_flutter(OSFlutterOutcomeEventsController.o)
-[OneSignalPlugin handleMethodCall:result:] in onesignal_flutter(OneSignalPlugin.o)
-[OSFlutterTagsController handleMethodCall:result:] in onesignal_flutter(OSFlutterTagsController.o)
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我尝试过但没有帮助:
pod deintegrate && rm Podfile.lock && pod install --repo-update
- 在 Podfile 中设置
- 在构建设置中手动设置架构为
arm64
platform :ios, '12.0'
这个问题我在两个 flutter 项目中遇到过,但我不知道如何解决。
更新: 看起来像是 OneSignal https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/389
的问题UPD2:
有问题的示例项目 https://github.com/rovkinmax/OneSignalSDKProblem