Android lint: Unbound xml namespace prefix. For resources of other build options only
My Android project consists of 4 build options: 2 product flavors and 2 build types. They all have their own resource files, for example:
xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_title">MyApp</string>
</resources>
When I run android lint it shows "Unbound XML namespace prefix" warning due to Android tools I am using to ignore "MissingTranslation". However, this warning is displayed for all files except the currently selected collector. When I switch buildVariant, the error for the file used for this buildVariant goes away.
So, I think the namespace cannot be found for different build options, so I can probably ignore this warning. I'm right? If yes: is there a way to suppress these warnings? If not: what should I do to fix it?
EDIT:
I found out that this happens not only with files with tools:ignore="MissingTranslation"
, but also with simple files like this one:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="description_logo_of_app">Logo of MyApp</string>
</resources>
Also, this only happens with one file per flavor / build type of product, apparently only line files (not sure if this is a match, or only first checks of lint files).
My workaround now suppresses the warning with the help <!--suppress XmlUnboundNsPrefix -->
above the tag <resources>
, but I don't like it. Better solutions are still welcome!
source to share
No one has answered this question yet
Check out similar questions: