NoClassDefFoundError in Runtime for class inside .AAR in Android Studio

I’ve been searching for a possible solution to this issue for many hours, but everything I tried just fails. This explains the situation:

I have this library project in Android Studio that generates a file app-debug.aar. Then I add this new module to the implementation project, following the .JAR / .AARs import wizard. I select .aarand update the dependency for :appin the project structure.

Once the project is cleared (even using ./gradlew clean- Mac OS X), I can make references to this class and its methods in any of the actions.

Now at runtime, once it is created and installed on real devices, the application will encounter the release of the aforementioned Execution Execution.

Note. I import .aarbecause I will need to protect the code and it has the resources, so the question is .jarout of the question. And if I import a library module (with source code and everything instead .aar), then there will be no problems when starting the application.

I tried everything, and if someone can shed light on what it might be, he will be highly appreciated.

The class extends ViewGroupand is created at runtime if this implies something. The code was provided to me, so major changes may not be possible if it is absolutely necessary.

Thanks in advance to everyone!

Armando

+4
source share
2 answers

NoClassDefFound , , ( " A" ). , , , , . lib , , . min version ( API), . backward-comp .aar , . , "".

0

, , , OP.

  • () , protobuf-lite , noclassdefFound, lib .aar . protobuf-lite , .

  • , , gradle `compile 'com.google.protobuf: protobuf-lite: 3.0.1', protobuf-jar maven libs , .

, gradle, , - .

0

All Articles