adwiv / android-fat-aar

Gradle script that allows you to merge and embed dependencies in generted aar file
The Unlicense
1.46k stars 435 forks source link

Embedding jars #9

Closed bambooer closed 8 years ago

bambooer commented 8 years ago

Hi, I am trying to package an AAR hiding all internal dependent jars that are published as maven artifact and your project is what all I need. It really rocks.

I am a newbie for Gradle and tried the following declaration:

dependencies {
    embedded 'com.xxxx.project:apdf:1.0-SNAPSHOT'
    embedded 'com.xxxx.project:android:2.0-SNAPSHOT'
    embedded 'com.xxxx.project:native:1.0-SNAPSHOT@aar'
}

When running gradle build, the project could be compiled but got:

* Where:
Script 'https://raw.githubusercontent.com/adwiv/android-fat-aar/master/fat-aar.gradle' line: 228

* What went wrong:
Execution failed for task ':embedRClassFiles'.
> /Users/tom.j/repo/noke/core/android/build/intermediates/exploded-aar/com.xxx.project/native/1.0-SNAPSHOT/AndroidManifest.xml (No such file or directory)

The AAR file used above is just a file packaged with native library files and does not include AndroidManifest.xml file.

Is it a bug or something wrong with my build file?

Thanks

adwiv commented 8 years ago

Are you sure it is an aar file? The AAR file format specifies that AndroidManifest.xml must be there. See http://tools.android.com/tech-docs/new-build-system/aar-format

Does the directory /Users/tom.j/repo/noke/core/android/build/intermediates/exploded-aar/com.xxx.project/native/1.0-SNAPSHOT/ exist? Also, what are the contents of the that directory?

bambooer commented 8 years ago

Yes, it is an AAR file which just contains a couple of native libs. I packed an empty manifest file and the native lib works here now.

But Gradle reports the manifest file could not be found /Users/tom.j/repo/noke/core/android/build/intermediates/exploded-aar/com.xxx.project/android/1.0-SNAPSHOT/. The dependency com.xxxx.project:android:2.0-SNAPSHOT is just a simple jar file containing a couple of android activities.

For time being, I have to move on by just dropping those things into the lib folder at the moment.

Anyway, thanks to your reply and great works.