flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

Error (Xcode): Framework not found geolocator

Open Bolling88 opened this issue 3 years ago • 8 comments

💬 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?

Bolling88 avatar Feb 07 '22 15:02 Bolling88

Hi @Bolling88,

This is an annoying issue which I am not quite sure what causes it. Could you try the following:

  1. From the terminal or console run: flutter clean;
  2. Remove the ios/Pods folder;
  3. Remove the ios/Podfile.lock file;
  4. Try compiling the App again (using the console this would be flutter build ios --no-codesign)

mvanbeusekom avatar Feb 07 '22 16:02 mvanbeusekom

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

Bolling88 avatar Feb 07 '22 16:02 Bolling88

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

mvanbeusekom avatar Feb 07 '22 16:02 mvanbeusekom

Unfortunately, that did not work either. Same error. No clues as to why in the log.

Bolling88 avatar Feb 07 '22 16:02 Bolling88

I have exactly the same issue.

gorebang avatar Feb 14 '22 02:02 gorebang

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....)

Bolling88 avatar Feb 14 '22 07:02 Bolling88

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.

blaneyneil avatar Feb 14 '22 20:02 blaneyneil

This solved my issues... much appreciated.

gorebang avatar Feb 15 '22 06:02 gorebang

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.

JeroenWeener avatar Jun 16 '23 07:06 JeroenWeener