Search code examples
androidassetsandroid-libraryaar

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?


Solution

  • 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