Closed devalp-pro closed 4 years ago
This issue is raised due to write functions in static method of flutter. Outside static method it's works. Thanks.
https://stackoverflow.com/a/51244003/7669884
π Bug Report
Getting MissingPluginException while calls getCurrentPosition function also got error on this function placemarkFromCoordinates.
[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method checkPermissionStatus on channel com.baseflow.flutter/location_permissions) E/flutter (32250): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:319:7) E/flutter (32250): E/flutter (32250): #1 LocationPermissions.checkPermissionStatus (package:location_permissions/src/location_permissions.dart:38:30) E/flutter (32250): #2 Geolocator._getLocationPermission (package:geolocator/geolocator.dart:201:10) E/flutter (32250): #3 Geolocator.getCurrentPosition (package:geolocator/geolocator.dart:101:47) E/flutter (32250): #4 _SearchPageState.callback (package:gramstands/pages/search_page.dart:181:18) E/flutter (32250): #5 callbackDispatcher. (package:geofence/callback_dispatcher.dart:25:13) E/flutter (32250): #6 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:402:55) E/flutter (32250): #7 MethodChannel.setMethodCallHandler. (package:flutter/src/services/platform_channel.dart:370:54) E/flutter (32250): #8 _DefaultBinaryMessenger.handlePlatformMessage (package:flutter/src/services/binding.dart:200:33) E/flutter (32250): #9 _invoke3. (dart:ui/hooks.dart:303:15) E/flutter (32250): #10 _rootRun (dart:async/zone.dart:1126:13) E/flutter (32250): #11 _CustomZone.run (dart:async/zone.dart:1023:19) E/flutter (32250): #12 _CustomZone.runGuarded (dart:async/zone.dart:925:7) E/flutter (32250): #13 _invoke3 (dart:ui/hooks.dart:302:10) E/flutter (32250): #14 _dispatchPlatformMessage (dart:ui/hooks.dart:162:5)
Expected behavior
Automatically Check Permission and Get Function for that.
Reproduction steps
Just Called below function in any static callback method. static void callback(Location location, GeofenceEvent geoEvent) async { Geolocator().getCurrentPosition().then((position) { print("Current Position in Callback => ${position.toJson()}"); }); }
Configuration
Doctor summary (to see all details, run flutter doctor -v): [β] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18362.720], locale en-IN)
[β] Android toolchain - develop for Android devices (Android SDK version 29.0.0) [β] Android Studio (version 3.6) [β] VS Code (version 1.43.2) [β] Connected device (1 available)
β’ No issues found!
**Version: 5.3.0
Platform:
- [ Still Not Checked ] π± iOS
- [x] π€ Android
run your application through command prompt..flutter run
This is actually the correct link to the problem's solution. The missing plugin error occurs when you recently added some package but your app in device doesn't contain related dependency because at hot reload it doesn't write all the code but only recent changes. So restarting the whole app again will solve the issue
π Bug Report
Getting MissingPluginException while calls getCurrentPosition function also got error on this function placemarkFromCoordinates.
[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method checkPermissionStatus on channel com.baseflow.flutter/location_permissions) E/flutter (32250): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:319:7) E/flutter (32250):
E/flutter (32250): #1 LocationPermissions.checkPermissionStatus (package:location_permissions/src/location_permissions.dart:38:30)
E/flutter (32250): #2 Geolocator._getLocationPermission (package:geolocator/geolocator.dart:201:10)
E/flutter (32250): #3 Geolocator.getCurrentPosition (package:geolocator/geolocator.dart:101:47)
E/flutter (32250): #4 _SearchPageState.callback (package:gramstands/pages/search_page.dart:181:18)
E/flutter (32250): #5 callbackDispatcher. (package:geofence/callback_dispatcher.dart:25:13)
E/flutter (32250): #6 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:402:55)
E/flutter (32250): #7 MethodChannel.setMethodCallHandler. (package:flutter/src/services/platform_channel.dart:370:54)
E/flutter (32250): #8 _DefaultBinaryMessenger.handlePlatformMessage (package:flutter/src/services/binding.dart:200:33)
E/flutter (32250): #9 _invoke3. (dart:ui/hooks.dart:303:15)
E/flutter (32250): #10 _rootRun (dart:async/zone.dart:1126:13)
E/flutter (32250): #11 _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (32250): #12 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (32250): #13 _invoke3 (dart:ui/hooks.dart:302:10)
E/flutter (32250): #14 _dispatchPlatformMessage (dart:ui/hooks.dart:162:5)
Expected behavior
Automatically Check Permission and Get Function for that.
Reproduction steps
Just Called below function in any static callback method. static void callback(Location location, GeofenceEvent geoEvent) async { Geolocator().getCurrentPosition().then((position) { print("Current Position in Callback => ${position.toJson()}"); }); }
Configuration
Doctor summary (to see all details, run flutter doctor -v): [β] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18362.720], locale en-IN)
[β] Android toolchain - develop for Android devices (Android SDK version 29.0.0) [β] Android Studio (version 3.6) [β] VS Code (version 1.43.2) [β] Connected device (1 available)
β’ No issues found!
**Version: 5.3.0
Platform: