Closed ncapdevi closed 7 years ago
I am also facing the same error. Did anyone find any solution?
Fatal Exception: java.lang.IllegalStateException: GoogleApiClient is not connected yet. at com.google.android.gms.internal.zzaas.zzb(Unknown Source) at com.google.android.gms.internal.zzaav.zzb(Unknown Source) at com.google.android.gms.internal.zzaat.zzb(Unknown Source) at com.google.android.gms.internal.zzary.requestLocationUpdates(Unknown Source) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationSource.requestLocationUpdate(GooglePlayServicesLocationSource.java:91) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationProvider.requestLocationUpdate(GooglePlayServicesLocationProvider.java:227) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationProvider.onResult(GooglePlayServicesLocationProvider.java:160) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationSource.onResult(GooglePlayServicesLocationSource.java:125) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationSource.onResult(GooglePlayServicesLocationSource.java:25) at com.google.android.gms.internal.zzaaf$zza.zzb(Unknown Source) at com.google.android.gms.internal.zzaaf$zza.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:7325) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
This is the major issue in my live app. Please fix this as soon as possible.
Thank you for your awesome work. :)
You're right, i'll take a look as soon as i have time. Meanwhile feel free to create a PR to fix it, if you'd like to.
It would be also nice to have the usecase, how you face this issue, what are the steps to reproduce and so on. But if you don't have it, it is still fine, i'll take a look.
Same problem here.. Any update on this?
I created a new LocationManager instance (with different configuration for my needs), but when call locationManager.get() I have the same problem reported here. PS: I think I have created the new LocationManager instance correctly.
@ncapdevi @BiswajitRout @dimkonomis @pmsferreira v2.0.4 is released, please try with that it should be fixed now. Thanks for patience and help.
@yayaa I updated your library to the last version but it seems that something is wrong. https://user-images.githubusercontent.com/16557512/29409737-8b8751e4-8345-11e7-85bb-99c52f99285a.png I have created a new LocationManager with a configuration that asks user to allow permissions or turn on GPS but even when I "allow" permission, i received the message “LocationManager: Couldn't get permission, Abort!”
So I tried to override onRequestPermissionsResult and force to call getLocation() (with GPS turned off) and I didn't received the prompt to turn on GPS and the messages were "DefaultLocationProvider: GPS is not enabled, moving on with Network..." and "Network is not enabled, calling fail..."
May the new LocationManager creation is wrong ?
Thanks
Configuration
java.lang.IllegalStateException: GoogleApiClient is not connected yet. at com.google.android.gms.internal.zzaas.zzb(Unknown Source:5) at com.google.android.gms.internal.zzaav.zzb(Unknown Source:5) at com.google.android.gms.internal.zzaat.zzb(Unknown Source:154) at com.google.android.gms.internal.zzary.removeLocationUpdates(Unknown Source:5) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationSource.removeLocationUpdates(GooglePlayServicesLocationSource.java:96) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationProvider.onLocationChanged(GooglePlayServicesLocationProvider.java:155) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationProvider.checkLastKnowLocation(GooglePlayServicesLocationProvider.java:209) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationProvider.onConnected(GooglePlayServicesLocationProvider.java:114) at com.yayandroid.locationmanager.providers.locationprovider.GooglePlayServicesLocationSource.onConnected(GooglePlayServicesLocationSource.java:113) at com.google.android.gms.common.internal.zzm.zzq(Unknown Source:125) at com.google.android.gms.internal.zzaat.zzo(Unknown Source:22) at com.google.android.gms.internal.zzaar.zzwi(Unknown Source:89) at com.google.android.gms.internal.zzaar.onConnected(Unknown Source:21) at com.google.android.gms.internal.zzaav.onConnected(Unknown Source:7) at com.google.android.gms.internal.zzaag.onConnected(Unknown Source:5) at com.google.android.gms.common.internal.zzl$1.onConnected(Unknown Source:2) at com.google.android.gms.common.internal.zzf$zzj.zzxG(Unknown Source:137) at com.google.android.gms.common.internal.zzf$zza.zzb(Unknown Source:46) at com.google.android.gms.common.internal.zzf$zza.zzu(Unknown Source:2) at com.google.android.gms.common.internal.zzf$zze.zzxH(Unknown Source:57) at com.google.android.gms.common.internal.zzf$zzd.handleMessage(Unknown Source:149) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)