GooglePlayServicesUtil could not be resolved

The latest update to com.google.android.gms:play-services-ads:8.4.0 leads to this error. This does not happen when com.google.android.gms:play-services:8.4.0 , but it greatly inflates the apk size. Also, to implement billing in the application, you need to check whether Google Play services are installed or not, before you start a purchase.

Is there a workaround for this?

+2
android google-play-services
Feb 14 '16 at 20:10
source share
2 answers

All you need to do to use GooglePlayServicesUtil includes the following dependency in your build.gradle file:

compile 'com.google.android.gms: play-services-base: 10.2.0'

Here you can see all the individual dependencies of the Services Services that you can choose from: https://developers.google.com/android/guides/setup#split

+4
Jul 12 '16 at 16:10
source share

I had the same problem, but in my case I did not add any other dependencies, even my problem was solved by simply changing the position of the apply plugin: 'com.google.gms.google-services' in the build.gradle file (Modile: app )

Line

 apply plugin: 'com.google.gms.google-services' 

was recorded last in the gradle file. Remove it from here and add it at the top, under the line apply plugin: 'com.android.application' Like this:

 apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' 

and synchronization. The problem is resolved.

0
Feb 06 '17 at 8:16
source share



All Articles