1

I created one library project with two modules. I added the 2nd module in the dependencies of the first module like this:

    implementation project(":module2")

I am able to generate the AAR file after this. But I'm getting

java.lang.NoClassDefFoundError

while running the client app.

Kindly help me find out what I am missing here.

PPB
  • 151
  • 1
  • 14
  • NoClassDefFoundError means that during compilation this class was presented but now (in runtime) it is absent. Maybe ProGuard/R8 obfuscation/shrink optimization has removed it. Are you sure that "NoClassDefFoundError" refers to one class included in ":module2"? – emandt Aug 23 '22 at 10:36
  • Yes it refers to one class of "module2" – PPB Aug 24 '22 at 05:05
  • If ":module2" it's yours and you've all it's source code: don't shrink/optimize/obfuscate it (without declaring relative rules in Proguard file) or who "imports" it could not have all methods/classes – emandt Aug 24 '22 at 09:37

1 Answers1

0
  • In your first module build.gradle file, you can include like ,

    api project(":module2")