建立谷歌-API的Java客户端的开发环境客户端、环境、API、Java

2023-09-12 10:14:13 作者:凭苲

我想正式例如日历-V2-原子机器人。我已经通过使用maven已经导入所有依赖关系,并成功地编译。当涉及到发生然而,在运行时,无级高清发现错误

I am trying the official example calendar-v2-atom-android. I have already import all dependency by using maven and it compile successfully. However, in run time , no class def found error occurs when it comes to

私人最终名单日历= Lists.newArrayList();

private final List calendars = Lists.newArrayList();

私人最终HttpTransport运输= AndroidHttp.newCompatibleTransport();

private final HttpTransport transport = AndroidHttp.newCompatibleTransport();

似乎无法找到类的库中运行。

It seems that it can't find the class in library in runtime.

我应该做的日食?

感谢你。

推荐答案

下载谷歌阿比Java客户端

Download the Google Api Java Client

在Eclipse项目中创建一个libs文件夹。

Create a libs folder in your eclipse project.

拖放不中 - 源端进入目录,你刚才提出的库的所有客户端文件。 不要添加依赖文件夹,而不是从文件夹到库文件夹内拖动的依赖关系。

Drag and drop all client files that do not end in -source into the libs folder you just made. Do not add the dependencies folder, instead drag the dependencies from inside the folder to the libs folder.

转到项目 - >属性 - > Java构建路径 - >库标签

Go to Project -> Properties -> Java Build Path -> Libraries Tab

点击添加罐,浏览到您的libs文件夹,并添加所有的客户端文件。

Click Add JARS, navigate to your libs folder and add all of the client files.

点击订单和出口标签,并选中了所有已添加的客户端文件。

Click the Order and Export tab and check off all the client files you added.

清洁项目。 你应该是好去。

Clean the project. You should be good to go.

更新

由于ADT启21时,安装程​​序的工作原理如下:

As of ADT Rev. 21, the setup works as follows:

在Eclipse项目创建一个libs文件夹 拖放不中 - 源端进入目录,你刚才提出的库的所有客户端文件。不要添加依赖文件夹,而不是从文件夹到库文件夹内拖动的依赖关系。 转到项目 - >属性 - > Java构建路径 - >订单和出口标签 检查关闭Android的私人图书馆的框,你是好去。
 
精彩推荐