Skip to content
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

NullPointerException on checkPermissions #995

Open
oscarshaitan opened this issue Sep 25, 2024 · 0 comments
Open

NullPointerException on checkPermissions #995

oscarshaitan opened this issue Sep 25, 2024 · 0 comments

Comments

@oscarshaitan
Copy link

Describe the bug

on executing the location.hasPermission()
I got sometimes the error

ava.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.error(java.lang.String, java.lang.String, java.lang.Object)' on a null object reference
	at com.lyokone.location.FlutterLocation.checkPermissions(FlutterLocation.java:331)
	at com.lyokone.location.MethodCallHandlerImpl.onHasPermission(MethodCallHandlerImpl.java:131)
	at com.lyokone.location.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:46)
	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:230)
	at android.os.Looper.loop(Looper.java:319)
	at android.app.ActivityThread.main(ActivityThread.java:8919)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

this could happens with or without permissions but usually happens on my first call in the system to check that permissions

Im using location: ^7.0.0 Flutter 3.24.3

Tested on:

  • Android, Samsung Galaxy note 22
  • Pixel 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant