0

I am having an external library (constants.aar) file. I have kept this .aar file in to my Android library module project's (sdk-module)/lib folder. This sdk-module has classes which uses methods from constants.aar.

Compiling the sdk-module generates sdk-module.aar file.

In my application i am including this sdk-module.aar file. When i am trying to use certain class files of sdk-module, i am getting NoClassDefFoundError.

java.lang.NoClassDefFoundError: Failed resolution of: "class file from constant.aar"; Caused by: java.lang.ClassNotFoundException: Didn't find class "xyz" on path:

I have unzipped the sdk-module.aar file and i can see that constants.aar file is available in its /lib folder.

How to resolve this issue?

Milad Bahmanabadi
  • 946
  • 11
  • 27
Amit
  • 11
  • 3
  • Try this by implementing MultiDex support - https://stackoverflow.com/questions/27698287/noclassdeffounderror-with-android-studio-on-android-4 – Asteroid Dec 03 '18 at 10:43

1 Answers1

0
android {
    defaultConfig {
        ....
        multiDexEnabled true // Add this line in your build.gradle file
    }

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
}

Extend : MultiDexApplication Class In in your ApplicationClass.java

public class BusinessCardApplication extends MultiDexApplication { ... }

OR

MultiDex.install(this); //add this line

Either, See this library's Issues File. If It Is from library's issue there is also define this error detail

Prince Dholakiya
  • 3,255
  • 27
  • 43