flutter-geocoding
                                
                                
                                
                                    flutter-geocoding copied to clipboard
                            
                            
                            
                        MissingPluginException(No implementation found for method placemarkFromCoordinates on channel flutter.baseflow.com/geocoding)
🔙 Regression
I got this error exception when trying to Add Flutter to Existing Native App (iOS)
Configuration
- add flutter app as framework into existing iOS App (Native Swift)
 
Version: 1.x
Platform:
- [ ] :iphone: iOS
 
i get same error running on android. flutter project doesn't pulls latest version of geocoding package (it refers to ^1.0.5) because of dependency conflict. any suggestions would highly appreciated. thanks
Dependency error while trying to point project to latest geocoding version.
Because geocoding >=2.0.0 depends on geocoding_platform_interface ^2.0.0 which depends on plugin_platform_interface ^2.0.0, geocoding >=2.0.0 requires plugin_platform_interface ^2.0.0. And because google_maps_flutter_platform_interface 1.2.0 depends on plugin_platform_interface ^1.0.1 and no versions of google_maps_flutter_platform_interface match >1.2.0 <2.0.0, geocoding >=2.0.0 is incompatible with google_maps_flutter_platform_interface ^1.2.0. And because google_maps_flutter 1.2.0 depends on google_maps_flutter_platform_interface ^1.2.0 and no versions of google_maps_flutter match >1.2.0 <2.0.0, geocoding >=2.0.0 is incompatible with google_maps_flutter ^1.2.0. So, because places_autocomplete depends on both google_maps_flutter ^1.2.0 and geocoding ^2.0.2, version solving failed. pub get failed (1; So, because places_autocomplete depends on both google_maps_flutter ^1.2.0 and geocoding ^2.0.2, version solving failed.)
Still happening in 2.0.2, is any extra step needed on installation?
Thats the code, are valid coordinates and is running on simulator iOS 14.4
List<Placemark> placemarks = await placemarkFromCoordinates(latitude, longitude);
print(placemarks);
There is the error
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method placemarkFromCoordinates on channel flutter.baseflow.com/geocoding)
#0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:165
<asynchronous suspension>
#1      MethodChannelGeocoding.placemarkFromCoordinates (package:geocoding_platform_interface/src/implementations/method_channel_geocoding.dart:56:24)
<asynchronous suspension>
                                    
                                    
                                    
                                
I get the same error on 2.0.4 testing on Android simulator. The code compiles, but this is thrown at runtime
MissingPluginException(No implementation found for method placemarkFromCoordinates on channel flutter.baseflow.com/geocoding)
The code in question using valid coordinates
import 'package:geocoding/geocoding.dart'; 
/// ...
List<Placemark> placemarks = await placemarkFromCoordinates(
          _currentPosition!.latitude, _currentPosition!.longitude,
          localeIdentifier: 'no_NO');
                                    
                                    
                                    
                                
I solved this by setting targetSdkVersion=31 and compileSdkVersion=31. The error then went away and an address was returned
In Flutter version 3.7.11 and dart version 2.19.6 compile sdk version 33 I'm also facing same issue.
I had the same issue after calling the api several times. Now I only call it after the previous call ends. It seems working.
This issue usually happens when the plugin is accessed before the Flutter engine had time to register all plugins. Make sure that the methods are not accessed before the runApp method of your Flutter application is called (especially in Flutter add-to-app applications).
If for some reason you do need to access the Geocoding API before the runApp method is called, make sure to first call the WidgetFlutterBindings.ensureInitialized() method before accessing the Geocoding API.
I had the same issue after calling the api several times. Now I only call it after the previous call ends. It seems working.
this one helped me to solve the issue