flutter-geolocator
flutter-geolocator copied to clipboard
Error (Xcode): Framework not found geolocator
💬 Questions and Help
I have tried everything, but the app fails to build and only outputs this at the end: Error (Xcode): Framework not found geolocator.
I have tried different versions of it, but always the same issue. Any idea on how to solve this?
Hi @Bolling88,
This is an annoying issue which I am not quite sure what causes it. Could you try the following:
- From the terminal or console run:
flutter clean
; - Remove the
ios/Pods
folder; - Remove the
ios/Podfile.lock
file; - Try compiling the App again (using the console this would be
flutter build ios --no-codesign
)
That did not work, unfortunately. The issue started after upgrading to the latest Flutter: [✓] Flutter (Channel stable, 2.10.0, on macOS 12.0.1 21A559 darwin-x64, locale en-SE) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] VS Code (version 1.55.2) [✓] VS Code (version 1.55.2) [✓] Connected device (3 available) [✓] HTTP Host Availability
One other thing to try is to remove the Flutter.podspec
file:
$ rm ios/Flutter/Flutter.podspec
$ flutter clean
After that try rebuilding the App: flutter build ios --no-codesign
Unfortunately, that did not work either. Same error. No clues as to why in the log.
I have exactly the same issue.
I have resolved this issue now. It was a mess, really. Basically, Gelolocator was not the one to blame. I removed Geolocator dependency, and all references to it, and I would get the same error anyways. Even after cleaning and removing the podfile etc.
I believe the core issue is that older Flutter projects create iOS with an Objective-C base, and not Swift, and with the recent versions of Flutter, some libs start to misbehave if the Flutter iOS project is created without swift support.
What worked was to delete the Flutter iOS folder/app, and recreate it with Swift support: flutter create -i swift . https://stackoverflow.com/a/58359348/1983904
(Then of course fix back all iOS configurations you had....)
the problem appears to be the geolocator_apple dependency:
https://pub.dev/packages/geolocator_apple
as soon as i upgraded from Geolocator 8.0.2 (8.0.3 is where the geolocator_apple version change happens) i couldn't get iOS to build on either a device or a simulator. no amount of flutter clean or removing Pods and Podfile.lock did a thing.
i unfortunately didn't save all the error logs i was getting, but via revisiting my chrome search history i was getting this:
"Lexical or Preprocessor Issue (Xcode): Expected module declaration"
after clearing out everything and reverting to 8.0.2, everything is fine again.
This solved my issues... much appreciated.
As we do not get other reports coming in, I am going to assume that the bug is not present in the latest version of the plugin (9.0.2). Please let me know if you do experience this issue on newer versions of the plugin.
For now I am going to close this issue. If the issue is still relevant, please open a new issue.