Based on Android Library Considerations:
Library modules cannot include raw assets
I created a sample android library module with assets in there (not in app module), then generated the aar file. I analyzed the resulting aar file, and voila, the assets/ folder is still there with all the files intact.
So, is it allowed or not allowed?
Asset folders contain the files for an individual asset.
Add your AAR or JAR as a dependencyNavigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Jar Dependency in the dropdown. In the Add Jar/Aar Dependency dialog, first enter the path to your . aar or .
In addition to JAR files, the Android uses a binary distribution format called Android ARchive(AAR). The . aar bundle is the binary distribution of an Android Library Project. An AAR is similar to a JAR file, but it can contain resources as well as compiled byte-code.
Inside the main folder you can add the assets folder. In Android Studio click on app folder, then src folder, then main folder . Inside main folder you can add Assets folder.
I think that some of the Development considerations are outdated. For example they also says that <uses-library>
elements must be declared in both the library and the application (this is now handled by the manifest merger).
By the way a few lines below, Anatomy of an AAR file shows that an AAR file may include an /assets/
directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With