How to reference an icon from a library project in the AndroidManifest.xml application

I am trying to use the same application icon for all applications obtained from the library project.

I thought it would be as simple as implementing the advice provided in this thread , but unfortunately it does not work.

What I did is add the following line to the <manifest> in the AndroidManifest.xml application:

 xmlns:mylib="http://schemas.android.com/apk/res/com.example.baseapp" 

And a few lines in the same AndroidManifest.xml file, change typical @drawable/icon to:

  <application android:icon="@mylib:drawable/icon"> 

But that will not work!

Instead, Eclipse tells me that:

error: Error: the resource was not found that matches the specified name (in the "icon" with value '@omlib: drawable / icon').

Apparently, the links to the drawings from the XML layout and the XML manifest do not match.

How to link icon from library project in AndroidManifest.xml application?

+7
source share
2 answers

Have you tried using only drawable / icon? I don't know about your setup, but it works for me.

Maybe after a good project and librairy release ...

+7
source

For people who are still reading this: I believe this has been fixed with SDK17.

you should write the following:

 xmlns:mylib="http://schemas.android.com/apk/res-auto" 

This should allow you to reference resources from library projects.

+5
source

All Articles