mrmans0n / smart-location-lib

Android library project that lets you manage the location updates to be as painless as possible
1.65k stars 352 forks source link

Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf #259

Open farzadi opened 5 years ago

farzadi commented 5 years ago

after adding

classpath 'com.google.gms:google-services:4.0.1'

to the project i get this error

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
        at com.google.android.gms.location.LocationServices.<clinit>(Unknown Source)
        at io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesProvider.init(LocationGooglePlayServicesProvider.java:79)
        at io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesWithFallbackProvider.init(LocationGooglePlayServicesWithFallbackProvider.java:45)
        at io.nlopez.smartlocation.SmartLocation$LocationControl.<init>(SmartLocation.java:173)
        at io.nlopez.smartlocation.SmartLocation.location(SmartLocation.java:67)
        at io.nlopez.smartlocation.SmartLocation.location(SmartLocation.java:59)
LeonardoCurvelo commented 5 years ago

Still happening in 3.3.0

ghost commented 5 years ago

It happening when using the gms services 15 or 16 version Use 'com.google.android.gms:play-services-maps:11.4.2'

Mentix commented 5 years ago

Work for me with this config:

implementation 'com.google.android.gms:play-services-maps:16.0.0' implementation 'com.google.android.gms:play-services-location:16.0.0'

implementation('io.nlopez.smartlocation:library:3.3.3') { transitive = false }

And call SmartLocation instance with:

SmartLocation.with(this).location(LocationGooglePlayServicesProvider())

The problem was resolved when change the location to LocationGooglePlayServiceProvider. Regards.

Mentix commented 5 years ago

after adding

classpath 'com.google.gms:google-services:4.0.1'

to the project i get this error

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
        at com.google.android.gms.location.LocationServices.<clinit>(Unknown Source)
        at io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesProvider.init(LocationGooglePlayServicesProvider.java:79)
        at io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesWithFallbackProvider.init(LocationGooglePlayServicesWithFallbackProvider.java:45)
        at io.nlopez.smartlocation.SmartLocation$LocationControl.<init>(SmartLocation.java:173)
        at io.nlopez.smartlocation.SmartLocation.location(SmartLocation.java:67)
        at io.nlopez.smartlocation.SmartLocation.location(SmartLocation.java:59)

Hello, You need use google maps? or another google service..

pavelpoley commented 5 years ago

It happening when using the gms services 15 or 16 version Use 'com.google.android.gms:play-services-maps:11.4.2'

Are you serious?

i-khan commented 4 years ago

Work for me with this config:

implementation 'com.google.android.gms:play-services-maps:16.0.0' implementation 'com.google.android.gms:play-services-location:16.0.0'

implementation('io.nlopez.smartlocation:library:3.3.3') { transitive = false }

And call SmartLocation instance with:

SmartLocation.with(this).location(LocationGooglePlayServicesProvider())

The problem was resolved when change the location to LocationGooglePlayServiceProvider. Regards.

this solved my issue, i haven't gone through in details yet, how did it fixed