Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class not included in the aar

I'm using Android Studio 1.0.1.

I managed to configure Android Library module in a project, so it's built into AAR.

My problem is that the AAR archive does not have my class inside. When I check MyProject/MyModule/build/intermediates/classes/debug/my/package/mymodule I can see my class compiled: MyClass.class

But when I enter to AAR (or unpack it), the very same directory (I mean the my/package/mymodule in classes.jar inside of the AAR file) contains only one file: BuildConfig.class

Why isn't my class included in the AAR?

like image 398
Googie Avatar asked Feb 02 '15 20:02

Googie


1 Answers

maybe it has to do with the proguard configuration i had the same problem, i resolved it by adding a rule in the proguard-rules file. here is exactly what i did:

  • adding rule -keep public class my.package.** { public *;} proguard-rules.pro file
  • run gradlew assemble on terminal

after that you will find your aar file in youModule/build/outputs/aar/ directory

Hope this help

like image 137
medhdj Avatar answered Sep 28 '22 18:09

medhdj