I am using a Referenced Library (Properties/Android/Library) in a parent project. The referenced library uses a color/transparent in one of its screens /layout files. The parent project also has a color/transparent, but with a different value than used in the referenced library’s color/transparent. The referenced library’s code uses the value in the parent project. I had to hard-code the referenced library’s value to a specific value via android:background=”#000000″. Is there a way to let the referenced library use its own color value instead of inheriting the parent project’s value for the same named attribute?
I am using a Referenced Library (Properties/Android/Library) in a parent project. The referenced library
Share
This is how Android Library Project is designed to work in Android SDK. Android Library Project is never built directly, it is always built indirectly when the dependent Main Project is built, when SDK compile/build the Main Project, the source and resource from Library Project is filtered and merged into Main Project. When same resource name is defined in both the main project and the library project, the one from main project always has the first priority.
Check out the official dev guide:
The solution is rename the resource name in Main Project to something else like color/transparent2. Hope this help.