Error package `com.google.android.gms…` doesn't exist

北战南征 提交于 2019-12-03 01:10:12
user4352520

Can't find the class com.google.android.gms.location.LocationClient (android)

There is some problem with the last GPS lib. You have to use an older version than the latest(6.+). Try with an older version. I didn't see anything inside the doc deprecated or missing about the LocationClient.class...

compile 'com.google.android.gms:play-services:5.+'

I think the best solution is, add compile API on your Gradle. services-location has this method.

 compile 'com.google.android.gms:play-services-maps:9.8.0'
 compile 'com.google.android.gms:play-services-location:9.8.0'

if you wish to include other services, please refer here: https://developers.google.com/android/guides/setup (scroll down)

Google Play Services is now modular, you can select the packages you want from it.

To get analytics add:

compile 'com.google.android.gms:play-services-analytics:7.3.0'

to you build.gradle's dependencies section

P.S replace 7.3.0 with new version as they arrive, or replace with "+" to always get the latest

Android Studio is complaining that it can't find the Play Services library.

Follow the steps here to ensure Google Play Services SDK is installed (specifically, make sure 'Google Repository' is installed along with 'Google Play Services'): http://developer.android.com/google/play-services/setup.html#Install

Then, make sure the following is added to the dependencies{} block in your build.gradle:

compile 'com.google.android.gms:play-services:+'

Clean and rebuild.

Add this line you build.gradle in Gradle Scripts folder

dependencies {
        compile 'com.google.android.gms:play-services:11.2.0'
    }

with this i solved this issue.

Previous answers were correct.

But in gradle:3.0 the compile configuration is now deprecated and should be replaced by implementation or api.

Check out more information in the documentation - API and implementation separation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!