Karumi / Dexter

Android library that simplifies the process of requesting permissions at runtime.
http://karumi.com
Apache License 2.0
5.23k stars 671 forks source link

Attempt to invoke virtual method 'void com.karumi.dexter.DexterInstance.onActivityDestroyed()' on a null object reference #153

Closed QinAndroid closed 7 years ago

QinAndroid commented 7 years ago
java.lang.RuntimeException: Unable to destroy activity {com.uf.ssp/com.karumi.dexter.DexterActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.karumi.dexter.DexterInstance.onActivityDestroyed()' on a null object reference
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4398)
    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4417)
    at android.app.ActivityThread.-wrap6(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1629)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:156)
    at android.app.ActivityThread.main(ActivityThread.java:6524)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.karumi.dexter.DexterInstance.onActivityDestroyed()' on a null object reference
    at com.karumi.dexter.Dexter.onActivityDestroyed(Dexter.java:145)
    at com.karumi.dexter.DexterActivity.onDestroy(DexterActivity.java:37)
    at android.app.Activity.performDestroy(Activity.java:7136)
    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1158)
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4385)
    ... 9 more

Version of the library

com.karumi:dexter:4.0.0

aldoborrero commented 7 years ago

Also, happens on 4.1.0

vinitthaker commented 7 years ago

Facing the same issue. Did you guys find the solution for this?

EmmettWilson commented 7 years ago

I believe this issue was already found and fixed on master. https://github.com/Karumi/Dexter/commit/d713fc52814e4e48a040b63bdb5e3a0e615eba9e

Serchinastico commented 7 years ago

It is now live, yes! It should be available in the newer version: 4.1.1

I totally forgot to give you an update on this, sorry about that.