GoogleApiClient class not found

I am trying to use google fit api to get the number of steps. I use a beginner's guide when I try to paste code

private GoogleApiClient mClient = null; 

Android Studio cannot 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' 

on my gradle.

Any suggestions? Thanks

EDIT:

I changed gradle to compile 'com.google.android.gms: play-services: 6.5.87' And now it works ... does anyone know why 7.0.0 does not work? Thanks

+6
source share
1 answer

I met a similar error before, I finally solved this problem using Android Studio.

You can use the following steps to register with Andorid Studio.

1) Open file-> Project structure 2) Check the dependency of the module. Check dependencies.

3) I am adding the Google services library to the general module. Therefore, I need to add dependencies to other modules. Associate dependencies with other modules

Hope this helps you.

Hello,

Richard

+1
source

Source: https://habr.com/ru/post/987999/


All Articles