GoogleApiClient could not be resolved

I work in Google App Indexing for my project.

Newbee for this feature. I just follow the lines of Google.

Notify about using Google API

This page suggests creating an instance of GoogleApiClient. I tried, but the error "GoogleApiClient error could not be resolved."

And I added the following libraries to my project.

1. Game services Google Client 2.Google api 3.Google http api client

Installed Google APIs

and

Libraries included

error

Error image

How can I solve this error?

+6
source share
2 answers
  • Copy the library project to / extras / google / google_play_services / libproject / google-play-services_lib / to the place where you support Android application projects (your projects folder).
  • Import the library project into the Eclipse workspace. Click "File"> "Import", select "Android"> "Existing Android code in the workspace" and go to the copy of the library project to import it (go to the google-play-services_lib folder).
  • In your application project, refer to the project of the Google Play services library (right-click on the project, properties, Android, click "Add ...", select the google-play-services_lib folder).
  • After you have added the Google Play services library as a dependency for your application project, open the application manifest file and add the following tag as a child of this element (this is a new requirement of the updated Google Play Services):

     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 

Then add this statement to your class (or fix the error):

import com.google.android.gms.common.api.GoogleApiClient


For Android Studio, follow the instructions here:

https://developers.google.com/android/guides/setup

+6
source

If you update the SDK all ...

  • Delete "google-play-services.jar" in the libs directory.
  • Import the google-play-services_lib project into the SDK ([your-sdk] \ extras \ google \ google_play_services \ libproject \ google-play-services_lib)
  • Click "Project"> "Right Click"> "Properties"> "Android"> click the "Add" button in the "Library" section and add the Google play library.
  • And ... Fix red warnings (?) :)

Hope this helps you ...

+1
source

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


All Articles