Baseflow / flutter-geolocator

Android and iOS Geolocation plugin for Flutter
https://baseflow.com/
MIT License
1.24k stars 645 forks source link

Build failed: definition of GeoLocatorPlugin must be imported from module #246

Closed p3sn closed 5 years ago

p3sn commented 5 years ago

💬 Questions and Help

Hi All,

If I want to use geolocator in my app, I get the following error message at build:

Xcode's output: ↳ === BUILD TARGET geolocator OF PROJECT Pods WITH CONFIGURATION Debug === /Users/xxx/development/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-3.0.1/ios/Classes/GeolocatorPlugin.m:4:17: error: definition of 'GeolocatorPlugin' must be imported from module 'geolocator.GeolocatorPlugin' before it is required @implementation GeolocatorPlugin ^ In module 'geolocator' imported from /Users/xxx/development/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-3.0.1/ios/Classes/GeolocatorPlugin.m:2: /Users/xxx/Projecten/flutter/alpha3/alpha3/build/ios/Debug-iphonesimulator/geolocator/geolocator.framework/Headers/GeolocatorPlugin.h:3:12: note: previous definition is here @interface GeolocatorPlugin : NSObject ^ 1 error generated.

This is my flutter doctor summary: Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.4 18E226, locale nl-NL) [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [✓] iOS toolchain - develop for iOS devices (Xcode 10.2) [!] Android Studio (version 3.3) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [✓] VS Code (version 1.33.0) [✓] Connected device (1 available)

I try to run it on an iOS emulator.

Regards, Peter

p3sn commented 5 years ago

Solved it by adding use_frameworks! after target 'Runner' do

in ios/Podfile