NoClassDefFoundError when running app in emulator/phone

I'm using Eclipse to manage my Android project, which uses Amazon's Android libraries for AWS. I have added the library jar files to a ./libs folder, from which I added the libraries to my Java Build Path (Project properties -> Java Build Path -> Libraries -> Add JARS...). My app compiles correctly, but when I run it on an emulator or on a phone, I get a NoClassDefFoundError. I understand that this error is usually thrown when the application is compiled correctly but the libraries end up missing from the exported apk file.

Did I miss a step?

Edit:

Here's the stack trace up to the point where my application references it.

java.lang.NoClassDefFoundError: org.apache.commons.httpclient.params.HttpClientParams
   at com.amazonaws.http.HttpClient.configureHttpClient(Unknown Source)
   at com.amazonaws.http.HttpClient.<init>(Unknown Source)
   at com.amazonaws.AmazonWebServiceClient.<init>(Unknown Source)
   at com.amazonaws.services.simpledb.AmazonSimpleDBClient.<init>(Unknown Source)
   at com.amazonaws.services.simpledb.AmazonSimpleDBClient.<init>(Unknown Source)
   at lee.medical.icu.dataentry.MainMenuActivity.connectToDb(MainMenuActivity.java:121)

Answers


Turns out, the jar files in the AWS SDK weren't properly built. It appears that they missed an old Apache library that is no longer publicly distributed. Amazon has updated the download, and the libraries no longer throw a NoClassDefFoundError.

Source: Forum post on AWS mobile dev forums


Do you see the libraries in the "Referenced libraries" point in the package view? If not, select the files in the project navigator, right click them "Build path" -> "add to buildpath"


I had the same problem, and I found the resolution in the post below. in short, you may want to place your external jar file in the libs directory (NOT in lib) then include it as an external jar file via right click on the project, then

properties >> java build path >> add external jars >> libs/yourLibrary.jar

the full explanation is here.


Need Your Help

Error in Update Multiple using PHP, MYSQL

php mysql

The code of update multiple page is given below

I can't import render after installing with pip on python 2.7

python python-2.7 render odoo-8

I was trying to install odoo8 in a virtual environment with python2.7 and I got an error that render was not installed, i installed using pip install render, but when i try to import render i'm get...