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: Attempt to invoke virtual method 'void android.app.Activity.startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)' on a null object reference #51

Open
mkraina opened this issue Oct 9, 2020 · 2 comments

Comments

@mkraina
Copy link

mkraina commented Oct 9, 2020

Hi, received this error

NullPointerException

Attempt to invoke virtual method 'void android.app.Activity.startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)' on a null object reference

com.google.android.gms.common.api.Status in startResolutionForResult at line 17
com.google.android.gms.common.api.ResolvableApiException in startResolutionForResult at line 3
com.heanoria.library.reactnative.locationenabler.RNAndroidLocationEnablerModule in onComplete at line 120
com.google.android.gms.tasks.zzi in run at line 4
android.os.Handler in handleCallback at line 883
android.os.Handler in dispatchMessage at line 100
com.google.android.gms.internal.tasks.zzb in dispatchMessage at line 6
android.os.Looper in loop at line 237
android.app.ActivityThread in main at line 8167
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 496
com.android.internal.os.ZygoteInit in main at line 1100

RNAndroidLocationEnablerModule l.120: resolvable.startResolutionForResult(getCurrentActivity(), REQUEST_CHECK_SETTINGS); is wrapped by trycatch, any idea why this is not handled here?

android versions affected: 9, 10

@Rose-mary-abraham
Copy link

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)' on a null object reference

at com.google.android.gms.common.api.Status.startResolutionForResult(com.google.android.gms:play-services-basement@@17.2.1:17)
at com.google.android.gms.common.api.ResolvableApiException.startResolutionForResult(com.google.android.gms:play-services-basement@@17.2.1:3)
at com.heanoria.library.reactnative.locationenabler.RNAndroidLocationEnablerModule.onComplete(RNAndroidLocationEnablerModule.java:120)
at com.google.android.gms.tasks.zzi.run(com.google.android.gms:play-services-tasks@@17.0.2:4)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.google.android.gms.internal.tasks.zzb.dispatchMessage(com.google.android.gms:play-services-tasks@@17.0.2:6)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6644)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

   Received the same crash in firebase crashlytics.
   Device
   Brand: SHARP
   Model: AQUOS U SHV37
   
   Operating System
   Version: 8.0.0
   
   Library version: 1.2.1

@ramakala-copart
Copy link

I am still facing this issue. Any work around?

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

3 participants