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:
- 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 -> Order and Export Tab
- Check off the box for "Android Private Libraries" and you're good to go.
精彩评论