开发者

Setting up Google-api-java-client developing environment

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 de开发者_运维知识库f found error occurs when it comes to

private final List calendars = Lists.newArrayList();

private final HttpTransport transport = AndroidHttp.newCompatibleTransport();

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

What should I do in eclipse?

Thank You.


Download the Google Api Java Client

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.

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

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.

Update

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

  1. Create a libs folder in your eclipse project
  2. 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.
  3. Go to Project -> Properties -> Java Build Path -> Order and Export Tab
  4. Check off the box for "Android Private Libraries" and you're good to go.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜