【问题标题】:ParseError at [row,col]:[66,34] Message: -xml-names-19990114#AttributeNSNotUnique?Button&layout_columnParseError at [row,col]:[66,34] 消息:-xml-names-19990114#AttributeNSNotUnique?Button&layout_column
【发布时间】:2021-06-21 03:41:21
【问题描述】:

我的应用程序出现错误,错误提示

    ParseError at [row,col]:[66,34] Message:         http://www.w3.org/TR/1999/REC-xml-names-19990114#AttributeNSNotUnique?        Button&layout_column 

我找不到错误在哪里..我不知道行和列是什么...可能在 xml 文件中?

这是 AndroidManifest 文件

    AndroidManifest.xml
    <?xml version="1.0" encoding="utf-8"?>
    <manifest     xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.***">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="App Name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
    <activity
        android:name="com.example.appname.MainActivity"
        android:theme="@style/Theme.AppCompat.NoActionBar"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER"    />
        </intent-filter>
    </activity>
    <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->

        <meta-data
            android:name="appname"
            android:value="ca-app-pub-2703074771097768~4557375307"/>. 
    </application>

【问题讨论】:

    标签: android android-studio


    【解决方案1】:

    作为答案here explains,您遇到的错误正在被更新版本的 Gradle 所掩盖。在我的情况下,我也有 [row][col] 消息,当我将我的 Gradle 版本从 4.2.2 降级到 4.1.3 并再次编译时,它现在向我显示了真正的错误(我有一个重复的属性我的 XMLs) 并且我能够解决它。

    【讨论】:

      【解决方案2】:

      我有类似的问题:

      ParseError at [row,col]:[8,279]
      Message: http://www.w3.org/TR/1999/REC-xml-names-19990114#AttributeNSNotUnique?androidx.constraintlayout.widget.ConstraintLayout&layout_width&http://schemas.android.com/apk/res/android
      

      你需要做什么:

      首先仔细阅读错误信息,在我的情况下,错误信息中提到有问题: ConstraintLayout&amp;layout_width 我最新的布局 xml 文件中的属性。

      就我而言,我错误地将layout_heightlayout_width 属性添加到&lt;layout&gt; 标记,这实际上仅用于数据绑定。因此,只需删除这些行,我就可以解决此问题。

      我最初拥有的layout

      <layout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent">
      

      为了解决这个问题,我做了:

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

      【讨论】:

      • 你是英雄 (y) 我犯的错误一模一样。我不知道我在想什么哈哈。
      • @MuhammadSaqib
      【解决方案3】:

      我遇到了接缝问题

      ParseError at [row,col]:[40,33] Message: http://www.w3.org/TR/1999/REC-xml-names-19990114#AttributePrefixUnbound?TextView&amp;tools:text&amp;tools

      很难找到问题出在哪里。

      喜欢这个答案 enter link description here

      我的问题出在某个 xml 文件中 TextView&amp;tools:text&amp;tools 所以我搜索了我所有的项目 Ctrl + Shift + F 然后我找到了我的问题。

      【讨论】:

        猜你喜欢
        • 2017-03-21
        • 1970-01-01
        • 1970-01-01
        • 2019-03-21
        • 1970-01-01
        • 2021-09-12
        • 2018-12-19
        • 1970-01-01
        • 2021-09-17
        相关资源
        最近更新 更多