问题
Based on the following links:
Best practice: Extending or overriding an Android library project class
https://developer.android.com/studio/write/add-resources.html#resource_merging
classes and resources in the Android library (AAR) are override-able. How about overriding an asset file? In my AAR file, I have an asset named first.xml
. I want to create my own first.xml
in my android project that overrides the file in my AAR. How do I do it?
回答1:
Here is the result of my test.
This is my assets/ inside the AAR:
-assets/
-a.xml
-b.xml
This is my assets/ inside my android project that depends on the AAR above:
-assets/
-b.xml
-c.xml
The resulting assets/ in my APK is below:
-assets/
-a.xml (from AAR)
-b.xml (from my project)
-c.xml (from my project)
来源:https://stackoverflow.com/questions/62115925/overriding-an-android-library-project-asset-file