6

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

ilan
  • 4,402
  • 6
  • 40
  • 76
  • Have you imported and added the `google-play-services` library project? – SlashG May 27 '15 at 10:41
  • Yes I did, see my edit: i added compile 'com.google.android.gms:play-services:7.0.0' to gradle not to manifest – ilan May 27 '15 at 10:45

1 Answers1

1

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