A third-party library is added to the dexedLib directory, but the library does not have .dex classes

For an extra feature in the Android app, I downloaded the source code for a third-party library. This was done for customization.

I am using Eclipse Juno.

I created the project from the source code, made the configuration, created the JAR. And I use the JAR library in my project. The code in my application calls the corresponding library functions on a specific screen.

The application compiles fine :)

However, when I launch my application and go to the screen where I use the library classes, I encounter a ClassNotFoundException for the library class.

I diagnosed even further and noticed that all Java class files are converted to DEX using the Dalvik VM.

All third-party libraries are placed in the dexedLib directory under bin, where a regular third-party JAR includes the META-INF directory and the classes.dex file. But, I added the JAR, included only the META-INF directory and NOT classes.dex. And, therefore, an exception.

I have not watched any logs where the Dalvik VM reports an error with a conversion error.

I cleaned the project several times, loaded / reloaded projects in Eclipse, but no luck.

The following article is also mentioned, which talks about the same problem, but for it the Eclipse project cleanup and reboot worked. android dexed lib is empty

Any help would be appreciated.

+4
source share
1 answer

since you are using Eclipse, the problem is probably related to how the assembly is created:

go to: project properties | Java Build Path | Order and Export

check again that your bank is on the list (it probably already exists). if so, check the box next to it so that the container will be exported when apk is created.

Enjoy ... PS. I suggest you upgrade to Android Studio or IntelliJ (the father of Android Studio). ADT for Eclipse is deprecated and is no longer supported.

+1
source

All Articles