Issue
How do I make the resources (string, dimen, color, etc.) in my Android library module private?
I've tried both documented ways of doing this and neither work...
- Following the official Android doc of creating a
res/values/public.xmldoes not work; all of the resources remain public in the app that uses this library. - Following Chris Banes's instruction (and reiterated in this StackOverflow answer) of creating a
res-public/values/public.xmlfolder does not work either; all of the resources are made private, but those listed in thepublic.xmlfile are not made public as they should be.
Does anyone have the definitive instructions for making library resources private? Are there any open-source libraries out there that have properly made their resources private?
I'm using...
- Android Studio v2.2.3
buildToolsVersion "24.0.2"com.android.tools.build:gradle:2.2.3
Solution
Option #2 actually works. I had not properly defined my sourceSets in my build.gradle...
sourceSets {
main.res.srcDirs = [
'src/main/res',
'src/main/res-public'
]
}
Answered By - Gus
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.