android - How to export AAR including its dependencies? -
i have android studio library project uses library.aar , library.jar. when export mylib.aar , use new aar different app/project, cannot find classes defined in library.aar , library.jar.
my build.gradle looks this:
apply plugin: 'com.android.library' android { compilesdkversion 21 buildtoolsversion "21.1.2" defaultconfig { minsdkversion 15 targetsdkversion 21 versioncode 1 versionname "1.0" } } dependencies { compile filetree(include: ['*.jar'], dir: 'libs') compile project(':library_dot_aar') compile project(':library_dot_jar') } i imported aar , jar files in android studio using new -> module -> import .jar or .aar package , add them dependencies in project structure -> module settings -> dependencies -> add module dependencies.
when unzipped mylib.aar 25kb (considering library.aar on 300kb, assume mylib.aar's size in same range) , included dependencies not included in it. how export aar includes dependencies inside itself?
you must check this answer:
there no mechanism combine library. it's bit complicated want control dependencies merged (for instance don't want include support-v4 in there). you'd need merge resources , android manifest.
at time there's no way hack something, unless sure resources have no conflicts between 2 res folders (for instance have strings_a.xml in 1 lib , strings_b.xml in other lib). way can "merge" 2 res folders copying them both same location (as opposed merge @ android res level).
for manifest it'd more complicated, doable custom code.
providing built-in mechanism low on our priority don't expect anytime soon.
Comments
Post a Comment