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

MissingPluginException(No implementation found for method placemarkFromCoordinates on channel flutter.baseflow.com/geocoding)

Open Limvunhoy opened this issue 3 years ago • 4 comments

🔙 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

Limvunhoy avatar Jan 11 '22 14:01 Limvunhoy

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

vbabaria avatar Jan 18 '22 17:01 vbabaria

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>

sh1l0n avatar Jan 26 '22 10:01 sh1l0n

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');

ahaaje avatar May 11 '22 17:05 ahaaje

I solved this by setting targetSdkVersion=31 and compileSdkVersion=31. The error then went away and an address was returned

ahaaje avatar May 12 '22 11:05 ahaaje

In Flutter version 3.7.11 and dart version 2.19.6 compile sdk version 33 I'm also facing same issue.

ps6067966 avatar Apr 16 '23 11:04 ps6067966

I had the same issue after calling the api several times. Now I only call it after the previous call ends. It seems working.

i-brain avatar Jun 02 '23 14:06 i-brain

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.

mvanbeusekom avatar Jul 12 '23 12:07 mvanbeusekom

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

Shaham-Ahammed avatar Apr 05 '24 11:04 Shaham-Ahammed