我收到此错误:
The import com.google.api.client cannot be resolved
我的配置如下:
项目属性 - Android:
Java构建路径:
即使重新启动 Eclipse,我仍然会收到以下错误。
任何人都可以帮忙吗?谢谢:D
我收到此错误:
The import com.google.api.client cannot be resolved
我的配置如下:
项目属性 - Android:
Java构建路径:
即使重新启动 Eclipse,我仍然会收到以下错误。
任何人都可以帮忙吗?谢谢:D
您尚未在项目中添加客户端库。 http://code.google.com/p/google-api-java-client/wiki/Setup。您将在上述链接中获得 google-api-java-client-1.14.1-beta.zip 文件。将这些 jar 文件保存在 Android 项目的 libs 文件夹中。
添加这个:
<!-- 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>
如果您像我一样尝试将 Google API 添加到 Android 应用程序,并且您使用的是 Eclipse,那么以下操作非常简单。
Right-click on a project, select "Google > Add Google APIs...", select
the Google API you need from the list of available Google APIs,
click Finish, and it will automatically download the API client library
来自https://code.google.com/p/google-api-java-client/wiki/Setup