New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MissingPluginException(No implementation found for method checkPermission on channel flutter.baseflow.com/geolocator) #1038
Comments
I too got this in production release. |
@mvanbeusekom look into this |
I got it too. I dropped the version of geolocato_android to 3.1.5 and it was OK. |
That is a bit strange. Do you add platform specific dependencies? All you would need in general is to depend on the |
Solved the problem for me. Thanks! |
I am not using a native plugin, I used the flutter package geolocator: ^8.2.0 |
Any solutions @patildarshan66 |
Doing more detailed research we found out the this exception occurs when calling the This reason this is happening is two fold:
On pre-Flutter 2.11, the workaround for this is to manually register the native platform implementations: //callback function
void callbackDispatcher() {
Workmanager().executeTask((task, inputData) async {
if (defaultTargetPlatform == TargetPlatform.android) {
GeolocatorAndroid.registerWith();
} else if (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.macOS) {
GeolocatorApple.registerWith();
} else if (defaultTargetPlatform == TargetPlatform.linux) {
GeolocatorLinux.registerWith();
}
await LocationService.getCurrentLocation();
print("Native called background task-1: $task");
return Future.value(true);
});
} Alternatively if you are running Flutter 2.11+, you can use the new //callback function
void callbackDispatcher() {
Workmanager().executeTask((task, inputData) async {
DartPluginRegistrant.ensureInitialized();
await LocationService.getCurrentLocation();
print("Native called background task-1: $task");
return Future.value(true);
});
} |
this solved my issue, just check on your pobspec.lock then change the version |
This is not the best solution, please check out the comment above and ensure you register the platform specific implementations. Going forward this will be the stable solution and new versions will rely on this. Of course if you are fine using an outdated version and pin versions in your pubspec.yaml, feel free to do so. However I strongly suggest refraining from doing so and follow instructions in the mentioned comment. |
fyi, for my problem ... i didnt put any geolocator process on background or isolated task. |
Check these lines of codes if they are present in your code or not. Adding them will resolve your issue:
After doing all these steps do a Hot Restart or Stop all and Run again. |
MissingPluginException(No implementation found for method checkPermission on channel flutter.baseflow.com/geolocator)
getting this issue in the production build
The text was updated successfully, but these errors were encountered: