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

Location Permission is crashing the app #120

Closed zahid--ali closed 7 years ago

zahid--ali commented 7 years ago

Exception java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=42, result=0, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.sadeeq.app/com.karumi.dexter.DexterActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

Version of the library

3.0.2

Serchinastico commented 7 years ago

Hi @zahid--ali

By any chance, are you using DialogOnAnyDeniedMultiplePermissionsListener or DialogOnDeniedPermissionListener? Those two classes are the only ones in Dexter calling Context::getResources() and throwing a NPE in that case would mean you are providing them with a null context.

Serchinastico commented 7 years ago

I was doing some testing today and I realized this is the same exact crash I was having when passing a null rootView to those listener implementations. I'm closing the issue as we don't have more information and that's probably the source of the problem.