I am creating an API with a custom view. In order to enable the view to have custom attributes in the XML I want to use the "Android Library Project" for the API. By this I can declare the definition of my custom attributes in an attrs.xml.

But I'm having problems to use the Library Project when exporting it to an JAR-file. The project referencing the JAR gets problems with the android resource files included in the JAR. Does anyone know how to accomplish this? Hope I've been clear in my question.
I cannot let the project be an open source project in this case.

[Update]
From: <http://developer.android.com/guide/developing/projects/index.html#considerations>

"You cannot export a library project to a JAR file
A library cannot be distributed as a binary file (such as a jar file). This is because the library project is compiled by the main project to use the correct resource IDs."

So I guess that kind of answers my question. I've tried a half working solution. It is to generate a JAR from the java source files and add only the Android xml resources, as attrs.xml to each project who use the JAR. But it is not a good solution for the thing I want to achieve. I want a JAR with both source and xml resources but haven't found a solution for this.