对于谷歌API任务的机器人样品固定依赖 [英] Fixing dependency for Google API task-android-sample
问题描述
我试图编译和运行谷歌的API网站任务的机器人样品code。我无法得到它与Maven工作,所以我结束了下载的所有jar文件。下面是我做的步骤:
I'm trying to compile and run the task-android-sample code from Google's API website. I couldn't get it to work with Maven so I ended up downloading all the jar files. Below are the steps I did:
1)导入下载任务的机器人样品项目到Eclipse
1) Import the downloaded task-android-sample project into Eclipse
2)google-api-java-client-1.4.1-beta.zip jar文件添加到我的项目(建设路,添加外部JAR)
2) Add google-api-java-client-1.4.1-beta.zip jar files to my project (Build path, add external jars)
3)下载任务的API jar文件并导入到我的项目:
HTTP://$c$c.google .COM / p /谷歌API-Java的客户端/维基/ API的#Tasks_API
3) Download Task API jar file and import to my project: http://code.google.com/p/google-api-java-client/wiki/APIs#Tasks_API
4)检查了所有的进口jar文件在构建路径的订单/导出部分
4) Check off all the import jar files in the Order/Export section of Build Path
5)清理项目
6)运行项目。
我收到以下错误:
- ClientCredentials无法解析到一个变量
- 进口com.google.api.services.samples.shared不能得到解决。
I get the following errors: - ClientCredentials cannot be resolved into a variable - The import com.google.api.services.samples.shared cannot be resolved.
我搜索在谷歌API的网站,找不到从何处下载文件。我做了谷歌搜索,但没有找到,将包含类的JAR文件。有人可以帮我解决这个问题的依赖?
I searched in the Google API website and couldn't find where to download the file from. I did a Google search and couldn't find a jar file that would contain the class. Can someone help me to solve this dependency issue?
的更新:11年9月20日**
我跟着在这里指定的指令:
<一href=\"http://samples.google-api-java-client.google$c$c.com/hg/tasks-android-sample/instructions.html\" rel=\"nofollow\">http://samples.google-api-java-client.google$c$c.com/hg/tasks-android-sample/instructions.html
UPDATE: 9/20/11 ** I followed the instructions specified here: http://samples.google-api-java-client.googlecode.com/hg/tasks-android-sample/instructions.html
在MVN来源:JAR安装命令不给我任何错误,但是当我运行MVN编译我收到以下错误:
The "mvn sources:jar install" command does not give me any error, but when I run "mvn compile" I get the following errors:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <My_Path>/google-api-java-client.samples/tasks-android-sample/src/main/java/com/google/api/services/samples/tasks/android/TasksSample.java: [221,53] package R does not exist
[ERROR] <My_Path>/google-api-java-client.samples/tasks-android-sample/src/main/java/com/google/api/services/samples/tasks/android/TasksSample.java: [225,20] package R does not exist
[INFO] 2 errors
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.707s
[INFO] Finished at: Tue Sep 20 23:15:09 CDT 2011
[INFO] Final Memory: 9M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project tasks-android-sample: Compilation failure: Compilation failure:
[ERROR] <My_Path>/google-api-java-client.samples/tasks-android-sample/src/main/java/com/google/api/services/samples/tasks/android/TasksSample.java:[221,53] package R does not exist
[ERROR] <My_Path>/google-api-java-client.samples/tasks-android-sample/src/main/java/com/google/api/services/samples/tasks/android/TasksSample.java: [225,20] package R does not exist
我已经验证我的Maven的安装按照Apache的指示,所以不知道为什么我仍然不能编译这个正常。
I already verify my maven installation as per Apache's instructions, so not sure why I can't still compile this properly.
推荐答案
这是现在固定。请再试一次。感谢您报告的问题。说明在这里:
This is now fixed. Please try it again. Thanks for reporting the problem. Instructions are here:
<一个href=\"http://samples.google-api-java-client.google$c$c.com/hg/tasks-android-sample/instructions.html?r=default\" rel=\"nofollow\">http://samples.google-api-java-client.google$c$c.com/hg/tasks-android-sample/instructions.html?r=default
这篇关于对于谷歌API任务的机器人样品固定依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!