Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assets in assets/ directory for Android library (aar)

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?

like image 497
user1506104 Avatar asked May 02 '18 06:05

user1506104


People also ask

What does asset folder contain?

Asset folders contain the files for an individual asset.

How do I add an AAR file to libs?

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 .

What is an AAR file Android?

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.

Where do I put assets in Android?

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.


1 Answers

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

like image 88
bwt Avatar answered Sep 28 '22 05:09

bwt