Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The import com.google.api.client cannot be resolved in Eclipse

I am getting this error:

The import com.google.api.client cannot be resolved

My configuration is below:

Project Properties - Android:

enter image description here

Java Build Path:

enter image description here

I still get the error below even after restarting Eclipse.

enter image description here

Can anyone help? Thx :D

like image 464
Alexis Avatar asked Mar 30 '13 02:03

Alexis


People also ask

How does googleapiclient connect to Google APIs?

Your GoogleApiClient instance will automatically connect after your activity calls onStart() and disconnect after calling onStop(). Your app can immediately begin making read requests to Google APIs after building GoogleApiClient, without waiting for the connection to complete.

Where is the Google API client library for Java?

The Google API Client Library for Java is in the central Maven repository . The Maven groupId for all artifacts for this library is com.google.api-client .

What is the use of the Google API client builder?

The GoogleApiClient.Builderclass provides methods that allow you to specify the Google APIs you want to use and your desired OAuth 2.0 scopes. Here is a code example that creates a GoogleApiClientinstance that connects with the Google Drive service:

What languages are supported by googleapiclient?

Accessing Google APIs with GoogleApiClient (deprecated) Google Play services LanguageEnglish Bahasa Indonesia Deutsch Español Français Português – Brasil Русский 中文 – 简体 日本語 한국어 Sign in Home Guides Reference Samples Support Downloads Google Play services Home


2 Answers

You haven't added the client libraries in your project. http://code.google.com/p/google-api-java-client/wiki/Setup. You will get the google-api-java-client-1.14.1-beta.zip file at the above link. Save those jar files in your libs folder of Android project.

like image 143
swapnil Avatar answered Nov 15 '22 00:11

swapnil


Add this:

<!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
<dependency>
    <groupId>com.google.api-client</groupId>
    <artifactId>google-api-client</artifactId>
    <version>1.23.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty -->
<dependency>
    <groupId>com.google.oauth-client</groupId>
    <artifactId>google-oauth-client-jetty</artifactId>
    <version>1.23.0</version>
</dependency>
like image 40
searching9x Avatar answered Nov 15 '22 00:11

searching9x