Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

import com.google.android.gms.common.api.GoogleApiClient; cannot be resolved

I want to make a login with Google+ login button like this Tutorial

I have copied the codes, set google_play_services libraries, added package name and SHA1 key in google api console, but there are some import errors :

This import is not an error :

    import com.google.android.gms.common.ConnectionResult;
    import com.google.android.gms.common.GooglePlayServicesUtil;
    import com.google.android.gms.common.SignInButton;

    import com.google.android.gms.plus.model.people.Person;

But this import an error (cannot be resolved) :

import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.plus.Plus;

Anybody have a solution ?

like image 782
Redturbo Avatar asked Feb 01 '15 11:02

Redturbo


2 Answers

Add this in yourbuild.gradle(app) inside dependency

compile 'com.google.android.gms:play-services:8.1.0'
like image 126
Ravi Yadav Avatar answered Oct 15 '22 01:10

Ravi Yadav


[Solved]

I try to download new version of google-play-services library and import error is gone.

So, always update/download newest version of google-play-services library..

like image 34
Redturbo Avatar answered Oct 15 '22 00:10

Redturbo