Isa Kuru
Isa Kuru

Reputation: 2089

android Jersey api client create NoClassDefFoundError

I am trying make a restful post from my android application. I have imported the jersey-core1.13, jersey-server1.13 and jersey client1.13 jar files to my project. And when I am creating the client like this :

 Client client = Client.create();

I am getting run time error :E/AndroidRuntime(540): java.lang.NoClassDefFoundError: com.sun.jersey.api.client.Client

What is the problem? Can anyone help?

Upvotes: 0

Views: 534

Answers (1)

Avinash Sahu
Avinash Sahu

Reputation: 249

This error comes normally if the build paths for jar files are not configured.

The best method to avoid this problem is keep all your jar files in a folder called libs (create the folder and copy all jars file). If you are using ADT 17+ (Not sure but at least it works in ADT 20)then it automatically configures the build path.

Note: Remove all external jar files from build path (ADT will automatically detect and configure them from libs folder )

Hope this helps you.

For pictorial description of method I described please refer to

http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17

Upvotes: 1

Related Questions