GooglePlayServicesUtil无法解析 [英] GooglePlayServicesUtil cannot be resolved
问题描述
最近更新为 com.google.android.gms:play-services-ads:8.4.0
会导致此错误。当使用 com.google.android.gms:play-services:8.4.0
时,这种情况不会发生,但它会显着增加apk大小。此外,为了实现应用内结算,在开始购买之前,需要检查Google Play服务是否已安装。
是否有解决方法?
依赖于你的build.gradle:
编译'com.google.android.gms:play-services-base:10.2.0'
在这里您可以看到您可以从中选择的所有单个Play服务依存关系:
https://developers.google.com/android/guides/setup#split
Recent updation to com.google.android.gms:play-services-ads:8.4.0
results in this error. This does not happen when com.google.android.gms:play-services:8.4.0
is used, but it bloats the apk size significantly. Also to implement in-app billing, it is needed to check whether Google Play services are installed or not before starting a purchase.
Is there a workaround for this?
All you need to do in order to use GooglePlayServicesUtil
is include the following dependency in your build.gradle:
compile 'com.google.android.gms:play-services-base:10.2.0'
Here you can see all the individual Play Services dependencies that you can pick from: https://developers.google.com/android/guides/setup#split
这篇关于GooglePlayServicesUtil无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!