Failed to access class from .aar file

I want to access the methods of the class that are inside the file .aar. I follow @PoliceEstebi on how to import a .aar file .

But still, I cannot access the class methods from the file .aar.

If someone can help, it will be great!

+4
source share
1 answer

Finally, I found a solution even on Gradle 1.1.0. I found help from here from @AliDK's answer.

create a folder in appby name aar.

make a copy of myLibrary.aarand enter app/aar. then

buildscript {
repositories {
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:1.1.0'
  }
}

allprojects {
repositories {
    jcenter()
    flatDir {
        dirs 'aar'
    }
  }
}

and write below code in MyProject/app > build.gradle

dependencies {
...
compile(name: 'myLibrary', ext: 'aar')
}

And it worked for me after spending 2 days.

@AliDK..

, .

+9

All Articles