2

I have been trying to run the sample code available at http://samples.google-api-java-client.googlecode.com/hg/tasks-android-sample/instructions.html

I have included all jar file needed to resolve the dependencies. My project doesn't contain any error but when i try to the program it give me following error:

java.lang.NoClassDefFoundError: com.google.api.client.googleapis.auth.oauth2.GoogleCredential

I can see that the above class file is present in my reference libraries still the code is not running. Trying to solve this from 2 days. Please help

Naved Alam
  • 827
  • 9
  • 25
  • 2
    use this http://stackoverflow.com/questions/9857539/noclassdeffounderror-when-googleanalyticstracker-getinstance/9857669#9857669 – Akram Oct 25 '12 at 07:21

2 Answers2

0

I think you should drop these jars in a folder named /libs at the root of your project. See this SO question: How can I use external JARs in an Android project?

Community
  • 1
  • 1
Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78
  • got it working....thanks....found out that jar should be /libs folder. Beside, some of the jar need to be added to build path. Some got added automatically from the classpath of other. Adding them manually gave errors. – Naved Alam Oct 25 '12 at 09:28
0

Have you included your libs in the java build path and checked it in the Order and Export Tab? i.e

Project > Properties > Java Build Path > Order and Export > and finally, checkmark your imported library.

ThePCWizard
  • 3,338
  • 2
  • 21
  • 32