Error: Suspicious namespace and prefix combination [NamespaceTypo] when I try create Signed APK

I Googled my problem but I can't find a solution.
When I try to create a signed APK, I get this error:

 Error:(6) Error: Suspicious namespace and prefix combination [NamespaceTypo]
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Explanation for issues of type "NamespaceTypo":
   track these down.
   xmlns:app="http://schemas.android.com/tools"
   obscure error messages. This check looks for potential misspellings to help
   Accidental misspellings in namespace declarations can lead to some very

This is the fragment of this layout file:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/tools"
    app:layout_behavior="@null"
    android:layout_gravity="bottom|right">

change the code xmlns:app="http://schemas.android.com/tools" with this:

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

It made mine work.


Your first two lines of the xml code are incorrect. The whole xml file should look as follows:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/tools"
app:layout_behavior="@null"
android:layout_gravity="bottom|right">

The first 2 lines are the declaration of the xml file. Although you are able to view the actual layout of the page in the design view, the layout itslef would still have issues when being built since it needs the xml tools tag.

The purpose of this namespace is to be able to record information in XML files, and have that information stripped when the application is packaged such that there is no runtime or download size penalty. It is a dedicated Android XML namespace.

Hope this helps :)