Flutter: Undefined symbols for architecture arm64
Asked Answered
L

2

9

After migrating to null-safety and flutter 2 I get problem with ios build:
I run flutter clean; rm ios/Podfile.lock pubspec.lock; rm -rf ios/Pods ios/Runner.xcworkspace; flutter run --flavor dev -t lib/main_dev.dart

and got this 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)

full log is here

What I try and it did't help:

  • pod deintegrate && rm Podfile.lock && pod install --repo-update
  • set up platform :ios, '12.0' in Podfile
  • set up manually architectures in Build Settings as arm64

This problem I have on two flutter projects, but I have no idea how to fix it.

UPD: It's look like a problem with OneSignal https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/389

UPD2:
sample project with problem https://github.com/rovkinmax/OneSignalSDKProblem

Loopy answered 3/5, 2021 at 11:11 Comment(7)
I'd also try recreating runner projects (iOS included) with flutter create .Bethel
Are you trying to run it on simulator, physical device, or archive?Hesperides
are you trying to Run with M1 Device?Milligram
I try run it on simulator and physical device. And I'm using mac book with intel proc.Loopy
Also I created sample with problem github.com/rovkinmax/OneSignalSDKProblemLoopy
What Xcode version are you using?Winstonwinstonn
@Winstonwinstonn 12.5Loopy
L
5

I found solution for this problem:

  1. Set up selected configurations as None

enter image description here

  1. Check that check box is turn on

enter image description here

More info here and here

Loopy answered 15/5, 2021 at 10:58 Comment(2)
didnt worked for meDismount
didn't work for meSkiver
R
3

I also faced this problem and fixed with

Build setting -> search Valid Architecture:

Remove armv7 from the list

If Xcode version > 12.0 Then go project or target -> Build Settings -> Excluded Architecture

Then Add armv7

Rectangle answered 4/10, 2021 at 10:2 Comment(2)
didn't work for meSkiver
Worked for me, but the value needs to be under the "Any IOS SDK" key inside Excluded ArchitecturesGrapery

© 2022 - 2024 — McMap. All rights reserved.