Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GoogleApiClient class not found

I'm trying to use google fit api for getting step count. I'm using the starter guide When i try to paste the code

private GoogleApiClient mClient = null;

Android studio can't find the "com.google.android.gms.common.api" package and the GoogleApiClient class.

i added

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

to my gradle.

Any suggestions? Thanks

EDIT:

I changed the gradle to compile 'com.google.android.gms:play-services:6.5.87' And now it works... does any one know why the 7.0.0 doesn't work? Thanks

like image 701
ilan Avatar asked May 27 '15 10:05

ilan


1 Answers

I have met similar bug before, I finally solved this problem using Android Studio.

You can using below steps to check in Andorid studio.

1) Open File->Project Structure 2) Check the Module's Dependencies. Check Dependencies.

3) I add Google play service library in common module. So I need to add dependencies to other modules. Link dependencies to other modules

Hope this can help you.

Regards,

Richard

like image 67
Richard Chen Avatar answered Nov 08 '22 21:11

Richard Chen