0

I created an aar file from an module and added it to my project it got added successfully but whenever I am trying to run my app then every time it is getting crashed saying classNotFoundException.

  • I tried to add dependencies in my module using implementation, api and compile (deprecated now) but still getting the same issue.
  • I hosted my aar file at Maven and tried to add that dependency in my project but still no luck and getting the same error every time.

There is a work around for the same I can add the those dependencies into my project which I added into my module but I do not want to that.

If I add my project as dependencies then it works fine but I do not want to that also as the module I am working on will be used by multiple clients and I do not want to share my source code with everyone.

I am using the following:

  • Android Studio 3.5.3
  • Android Gradle Plugin version 3.5.3
  • Gradle version 5.4.1
  • Min SDK Version 21, compile SDK version 29
  • JDK 8

Is there anything I am doing wrong or I am missing, any help will be appreciated.

Edit 1

I am not using proguard that is disabled.

1 Answers1

0

It is related to proguard, try adding a rule to keep the class in proguard-rules.pro file

-keep class com.app.package.** { *; }
-dontwarn com.app.package.**

replace 'com.app.package ' with your package (where the Notfound class exist)

Oussèma Hassine
  • 741
  • 1
  • 7
  • 18