DarshanGowda0 / GeoFlutterFire

:fire:GeoFlutterFire:fire: is an open-source library that allows you to store and query firestore documents based on their geographic location.
https://youtu.be/MYHVyl-juUk
MIT License
306 stars 261 forks source link

iOS build fails #61

Open blackbeario opened 4 years ago

blackbeario commented 4 years ago

Since upgrading to Xcode 11.2 for Mac Mojave I am getting this error trying to build for iOS.

Xcode build done.                                           30.7s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    /Users/jfraz/development/flutter/.pub-cache/hosted/pub.dartlang.org/geoflutterfire-2.0.3+5/ios/Classes/GeoflutterfirePlugin.m:4:17: error: definition of 'GeoflutterfirePlugin' must be imported from module 'geoflutterfire.GeoflutterfirePlugin' before it is required
    @implementation GeoflutterfirePlugin
                    ^
    In module 'geoflutterfire' imported from /Users/jfraz/development/flutter/.pub-cache/hosted/pub.dartlang.org/geoflutterfire-2.0.3+5/ios/Classes/GeoflutterfirePlugin.m:2:
    /Users/jfraz/development/stuller_power/build/ios/Debug-iphonesimulator/geoflutterfire/geoflutterfire.framework/Headers/GeoflutterfirePlugin.h:3:12: note: previous definition is here
    @interface GeoflutterfirePlugin : NSObject<FlutterPlugin>
               ^
    1 error generated.
Could not build the application for the simulator.
Error launching application on iPad Pro (11-inch).
Exited (sigterm)

Here is flutter doctor output:

[✓] Flutter (Channel dev, v1.10.15, on Mac OS X 10.14.6 18G103, locale en-US)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.40.1)
[✓] Connected device (3 available)

! Doctor found issues in 1 category.

Finally, here is the relevant pubspec.yaml info:


environment:
  sdk: ">=2.2.2 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  font_awesome_flutter: 8.4.0
  flare_flutter: ^1.5.4

  firebase_core: ^0.4.0+3
  firebase_auth: ^0.11.1+6
  cloud_firestore: ^0.12.5

  rxdart: ^0.22.0
  geoflutterfire: ^2.0.3+5
  location: 2.3.5
  google_maps_flutter: ^0.5.16
  geohash: ^0.2.1

  provider: ^2.0.1
  meta: ^1.1.6
  url_launcher: ^5.0.3
  # path_provider: ^1.0.0
  date_format: ^1.0.6
  table_calendar: ^2.1.0

dev_dependencies:
  flutter_test:
    sdk: flutter
jcsena commented 4 years ago

@blackbeario did you find any solution?

thanksmister commented 4 years ago

I fixed this issue by doing a flutter clean then adding to the Podfile this line use_frameworks! # required by Geolocator as outlined here https://stackoverflow.com/questions/51056579/flutter-plugin-geolocator-swift-h-file-not-found/55293055#55293055.

anthony-bernardo commented 4 years ago

Not working for me, even with @thanksmister link

lukestokes94 commented 4 years ago

@xero88 this seems to happen whenever there is an upgrade for Flutter. The workaround I'm using is to let Flutter update and then delete Xcode's derived data and then rebuild the app:

rm -rf ~/Library/Developer/Xcode/DerivedData rm -rf Pods rm -rf podfile flutter clean flutter run

Not sure how necessary all steps are but the first is vital.

Edit - fairly sure this occurs when you have your project directory stored within iCloud. Move it local into your files and this issue vanishes.