转载自:https://blog.csdn.net/csdndouniwan/article/details/52396364
Error: Suspicious namespace and prefix combination [NamespaceTypo] when I try create Signed APK
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 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">
解决方案:
前两行xml代码是不正确的。整个xml文件应该如下:前2行是声明的xml文件。虽然你可以查看页面的实际布局在设计视图中,布局itslef在建时仍会有问题,因为它需要xml工具标签。这个名称空间的目的是能够在XML文件中记录信息,并且这些信息被当应用程序打包,这样没有运行时或者下载大小处罚。它是一个专用的AndroidXML名称空间。希望这有助于:)
原文:
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 :)
解决方案:
更改代码xmlns:应用="http://schemas.android.com/tools"与此:它使我的工作。
原文:
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.
总结一下:
也就是说改一下布局文件的xmlns:app="http://schemas.android.com/tools" with this: 改成 xmlns:app="http://schemas.android.com/apk/res-auto"