yayaa / LocationManager

Simplify getting user's location for Android
807 stars 186 forks source link

Crash app android.location.ILocationManager.isProviderEnabled on a null object #87

Closed diorous closed 4 years ago

diorous commented 6 years ago

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.location.ILocationManager.isProviderEnabled(java.lang.String)' on a null object reference at android.location.LocationManager.isProviderEnabled(LocationManager.java:1156) at com.yayandroid.locationmanager.providers.locationprovider.DefaultLocationSource.isProviderEnabled(DefaultLocationSource.java:35) at com.yayandroid.locationmanager.providers.locationprovider.DefaultLocationProvider.isGPSProviderEnabled(DefaultLocationProvider.java:205) at com.yayandroid.locationmanager.providers.locationprovider.DefaultLocationProvider.get(DefaultLocationProvider.java:104) at com.yayandroid.locationmanager.providers.locationprovider.DispatcherLocationProvider.continueWithDefaultProviders(DispatcherLocationProvider.java:203) at com.yayandroid.locationmanager.providers.locationprovider.DispatcherLocationProvider.onFallback(DispatcherLocationProvider.java:125) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationProvider.failed(GooglePlayServicesLocationProvider.java:266) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationProvider.onConnectionSuspended(GooglePlayServicesLocationProvider.java:137) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationSource.onConnectionSuspended(GooglePlayServicesLocationSource.java:118) at com.google.android.gms.common.internal.zzae.zzcf(Unknown Source) at com.google.android.gms.common.api.internal.zzba.zzf(Unknown Source) at com.google.android.gms.common.api.internal.zzal.onConnectionSuspended(Unknown Source) at com.google.android.gms.common.api.internal.zzbi.onConnectionSuspended(Unknown Source) at com.google.android.gms.common.api.internal.zzt.onConnectionSuspended(Unknown Source) at com.google.android.gms.common.internal.zzac.onConnectionSuspended(Unknown Source) at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5461) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Device: Redmi Note 4 OS: 6.0.1100

yayaa commented 6 years ago

Thanks for reporting! Could you please also share your configuration? And if it is reproducable, please share the logcat output so I can follow on what happens

yayaa commented 4 years ago

From the stacktrace, it looks like something went wrong in framework code at android.location.LocationManager.isProviderEnabled(LocationManager.java:1156) which I cannot identify nor reproduce at the moment. Closing this because of lack of information, feel free to re-open if this still happens and you can provide more information.