Repository navigation
[google_maps_flutter] iOS - undefined symbols for architecture #59683
Copy link
Copy link
Closed
Labels
a: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowa: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.p: mapsGoogle Maps pluginGoogle Maps pluginp: path_providerPlugin that provides resolved paths to some platform directoriesPlugin that provides resolved paths to some platform directoriespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specifically
Description
Steps to Reproduce
- Create an add-to-app module
- Add the dependency
google_maps_flutter: ^0.5.28+1to pubspec.yaml - Run
flutter build ios-framework --xcframework --no-universal. - Add the generated frameworks to xCode project
- Run the project
Expected results:
Success
Actual results:
Error with message,
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GMSMarker", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapMarkerController.o)
...
Logs
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GMSMarker", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapMarkerController.o)
"_OBJC_CLASS_$_GMSCameraUpdate", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_GMSCircle", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapCircleController.o)
"_OBJC_CLASS_$_GMSPolygon", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapPolygonController.o)
"_OBJC_CLASS_$_GMSMutablePath", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapPolylineController.o)
objc-class-ref in google_maps_flutter(GoogleMapPolygonController.o)
"_OBJC_CLASS_$_GMSCameraPosition", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_GMSCoordinateBounds", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_GMSMapView", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_GMSPolyline", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapPolylineController.o)
"_kGMSMinZoomLevel", referenced from:
_InterpretMapOptions in google_maps_flutter(GoogleMapController.o)
"_OBJC_CLASS_$_GMSMapStyle", referenced from:
objc-class-ref in google_maps_flutter(GoogleMapController.o)
"_kGMSMaxZoomLevel", referenced from:
_InterpretMapOptions in google_maps_flutter(GoogleMapController.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
flutter analyze
The plugin `flutter_plugin_android_lifecycle` is built using an older version of the Android plugin API which assumes
that it's running in a full-Flutter environment. It may have undefined behaviors when Flutter is integrated into an
existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.
Analyzing wcpsdm...
No issues found! (ran in 10.3s)
flutter doctor:
[✓] Flutter (Channel stable, v1.17.3, on Mac OS X 10.15.4 19E287, locale en-PT)
• Flutter version 1.17.3 at /Users/tiagoantunes/Workspace/FlutterProjects/flutter
• Framework revision b041144f83 (13 days ago), 2020-06-04 09:26:11 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/tiagoantunes/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.46.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0
[✓] Connected device (1 available)
• *** iPhone • ***** • ios • iOS 13.5.1
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowa: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.p: mapsGoogle Maps pluginGoogle Maps pluginp: path_providerPlugin that provides resolved paths to some platform directoriesPlugin that provides resolved paths to some platform directoriespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specifically
Activity
TahaTesser commentedon Jun 19, 2020
"Hi @tiagoantunes
Please try this possible solution
Can you please provide your
flutter doctor -vand target ios versionThank you
tiagoantunes commentedon Jun 19, 2020
The presented solution maybe doesn't work for the AddToApp modules. I tried with the modules directory adaptation without success.
logs:
flutter doctor -v
tiagoantunes commentedon Jun 19, 2020
Additional Logs:

TahaTesser commentedon Jun 22, 2020
Hi @tiagoantunes
Just tested latest master using
google_maps_flutter: ^0.5.28+1, no issuesJust try the following in a new project
After building module, open
basic_ios.xcworkspaceDrag your frameworks in build phases as seen below and make sure to target ios 13 at least
pod installfrom ios folder and run the apptiagoantunes commentedon Jun 22, 2020
I created a new project with the same libraries, just like you. I was able to run with success. After that, I created a podfile to provide cocoapods libraries to the iOS project. After adding the following dependencies, the project starts to do the same initial error. I think the problem here is related to that.
tiagoantunes commentedon Jun 23, 2020
I @TahaTesser, thanks for all your support so far! I tried to make simpler to reproduce the issue. In one side I created a sample flutter module with the following dependencies that only initialize one database table.
After that, I generated the iOS frameworks,
And created a sample iOS project to embed the flutter module.
When I try to run the following code this error occurs,
If I remove this line,
GeneratedPluginRegistrant.register(with: flutterEngine)the project run without errors but the sqflite isn't correctly initiated and threw the following error:I think the
path_providerplay a certainty rule here, but just a suspicion. Reproducible in the Stable, Beta and Dev channels.TahaTesser commentedon Jun 25, 2020
Hi @tiagoantunes
Looks like your issue might be caused by sqflite
Can you please try without sqflite and with path_provider?
Thank you
tiagoantunes commentedon Jun 25, 2020
Hello @TahaTesser,
With the same setup as above but without sqflite;
I remove this line,
GeneratedPluginRegistrant.register(with: flutterEngine)And the result is:
19 remaining items
tiagoantunes commentedon Sep 8, 2020
@TahaTesser The issue is fixed in the latest stable version; thanks for all the support.
TahaTesser commentedon Sep 8, 2020
Hi @tiagoantunes
That's good news, given your last message I feel safe to close this issue, if you disagree please write in the comments and I will reopen it.
Thank you
tiagoantunes commentedon Sep 8, 2020
@TahaTesser I'm sorry for wrongly claim that this issue is already fixed but sadly it's not. I have not tested the full setup before; with the latest stable version 1.20.3 the problem persists exactly has reported initially.
tiagoantunes commentedon Sep 15, 2020
Based on recent developments in this merge and information on this issue my team colleague came with a temporary solution for the reported issue.
On the iOS host app, setup cocoapods dependencies and add the
GoogleMapspod, forcing the following version< 3.10.Now we can run the iOS project with flutter AddToApp framework dependencies. Despite the accomplished solution correct the initial issue we understand that is not the most elegant way to correct the problem. We shared that knowledge trying to help the community to understand more easily the problem.
JeetBhattachariya commentedon Oct 6, 2020
I am getting the same issue for many packages.
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
E/flutter (22779): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)
and many of you suggested to make some changes in MainActivity.java but in the current revision flutter is asking us to remove the file for migration. Its just so confusing because I ran flutter clean , restarted and did everything suggested. But this error is not going away.
TahaTesser commentedon Oct 29, 2020
Hi @tiagoantunes
Are you still experiencing this issue on
stablechannel 1.22.2?If yes, can you please reproducible steps that actually reproduce the issue on the stable channel
Thank you
pedromassangocode commentedon Nov 24, 2020
Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.
Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of
flutter doctor -v.All system setups can be slightly different, so it's always better to open new issues and reference related issues.
github-actions commentedon Aug 9, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.