I have a custom preferences control that I have defined a few attributes for in values/attrs.xml. Just to focus the conversation, here is an example of attributes that coul
Maybe a bit late, but the issue appears to be fixed in the latest (r14) release of the dev tools.
This is a known issue in Android. A fix is expected in the next release (r13) of the development tools.
Me too had the same problem. My app not detected the library-project styleable xml.
I tried this:
My Library Project package : com.lib.mylibrary My Application Project package : com.app.myapp
I tried xmlns:custom="http://schemas.android.com/apk/res/com.app.myapp
instead of xmlns:custom="http://schemas.android.com/apk/res/com.lib.mylib
It worked fine ie. try
xmlns:custom="http://schemas.android.com/apk/res/<your app package>
instead of
xmlns:custom="http://schemas.android.com/apk/res/<your lib project package>
I got this idea here
I actually played a lot with styleable and libraries and have the following observations:
Imagine that you have a project that has main project and included library:
main
|--- library
xmlns:custom="http://schemas.android.com/apk/res/YOUR_LIBRARY_PACKAGE"
Surprisingly what works instead is xmlns:custom="http://schemas.android.com/apk/res/YOUR_MAIN_APP_PACKAGE"
(!)
It indeed looks like an overlook from android team, but once you know it, it works flawlessly.This fixed it for me. I also remember having this issue with Xamarin and the same solution worked for Xamarin.
xmlns:ab="http://schemas.android.com/apk/res-auto"
Use http://schemas.android.com/apk/res-auto
I found this solution given casually as a side-note in the AndroidSVG project:
Aside: Note the special schema URL in the namespace. If you were using a custom View from your own project you would use a URL based on your package name. For example http://schemas.android.com/apk/res/com.example.customview. But since the custom View is in an included library you should use the res-auto short-cut. The real schema URL will be automatically inserted when your app is built.
(I fixed a typo - missing /res/ subfolder - in the quoted text above)