Android:属性名称包含无效字符''

时间:2016-11-16 16:36:49

标签: java android xml manifest

我正在创建一个使用多个标签的应用。所以当我运行我的应用程序时,我收到这3个错误。这些错误无处不在 -

Error:(14) Tag <uses-permission> attribute name has invalid character ' '.

Error:(14) Tag <uses-permission> attribute name has invalid character ' '.

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

当我将鼠标悬停在清单文件上的红色标记文本上时,我收到此错误

 `“URI is not Registered”?`

这是清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.ict.seneca.androidpocketguide"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="21"
        android:targetSdkVersion="23" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission. ACCESS_COARSE_LOCATION" />

    <application
        android:name="com.android.tools.fd.runtime.BootstrapApplication"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity android:name="com.android.ict.seneca.androidpocketguide.MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.android.ict.seneca.androidpocketguide.SecondActivity"
            android:label="Second Activity" >
            <intent-filter>
                <action android:name="com.android.ict.seneca.androidpocketguide.addlocation" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.android.ict.seneca.androidpocketguide.About"
            android:label="About" >
            <intent-filter>
                <action android:name="com.android.ict.seneca.androidpocketguide.about" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.android.ict.seneca.androidpocketguide.Websites"
            android:label="Websites" >
            <intent-filter>
                <action android:name="com.android.ict.seneca.androidpocketguide.navigate" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.android.ict.seneca.androidpocketguide.SingleListItem"
            android:label="Single Item Selected" >
        </activity>
    </application>

</manifest>

1 个答案:

答案 0 :(得分:0)

删除上一个权限中的空格

<uses-permission android:name="android.permission. ACCESS_COARSE_LOCATION" />

到:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />