Reputation: 5845
I am getting the following error when I am trying to use the library during runtime: java.lang.NoClassDefFoundError: com.google.api.client.extensions.android2.AndroidHttp I have added this library to my project, it is the first jar of the Maven dependencies( I am not 100% used to Maven though).
Also,My understanding is that Ant is looking for the jars in a libs folder, but Maven is using its own folder, and that works fine for an other project. So I am lost..any clues/help on how should I troubleshoot this would be much appreciated!
Upvotes: 2
Views: 2860
Reputation: 41126
As a quick fix, By ticking Maven Dependencies
in Java Build Path - Order and Export
window should solve NoClassDefFoundError.
According to the screenshot you attached, it looks like you setup (or import) your Android project in Eclipse by the standard way google suggest in dev guide, but also somehow use Maven manage some of jar dependencies. This is not recommended, you should use either purely google standard way (libs/ folder since r17) or completely mavenize your android project for Dependency management.
Upvotes: 2
Reputation: 12352
Create a new folder called libs
under your project folder and add this library to that folder.
I was having the same problem with kSOAP library and this solved my problem...
EDIT
I just saw that you already have that folder. Add the library...
Upvotes: 0
Reputation: 12128
Seems that the library is not exported.
Under your project folder, open the .classpath
file, double check this line:
<classpathentry exported="true" kind="lib" path="google-http-client-android2-1.8.3-beta.jar"/>
If exported="false"
, change it to exported="true"
.
Upvotes: 0
Reputation: 34765
Seems that you have not added the jar properly. Also seems that you have missed step 6 .
If you want to include this jar into your Android project, then you just do the following steps in your Eclipse environment.
Upvotes: 3