简体   繁体   中英

Attribute is missing the Android namespace prefix in app manifest

I am building a N64 emulator for android, all is going well until I clean it and get a ton of errors in my manifest file. The error is:

Attribute is missing the Android namespace prefix

Here is the code for my manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bytecode.v3.alpha"
android:installLocation="auto"
android:versionCode="37"
android:versionName="3.a.0 (debug)" >

<uses-feature android:glEsVersion="0x00020000" />
<uses-feature
    android:name="android.hardware.touchscreen"
    android:required="false" />

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

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

<application
    android:name="com.bytecode.n64emu4droid.AppMupen64Plus"
    android:allowBackup="true"
    android:isGame="true"
    android:hardwareAccelerated="true"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@style/appTheme" >
    <activity
        android:name="com.bytecode.n64emu4droid.SplashActivity"
        android:label="@string/SplashActivity_title"
        android:theme="@style/appTheme.Black" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="tv.ouya.intent.category.GAME" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:host="*" />
            <data android:scheme="file" />
            <data android:mimeType="*/*" />
            <data android:pathPattern=".*\\.n64" />
            <data android:pathPattern=".*\\.N64" />
            <data android:pathPattern=".*\\.v64" />
            <data android:pathPattern=".*\\.V64" />
            <data android:pathPattern=".*\\.z64" />
            <data android:pathPattern=".*\\.Z64" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.GalleryActivity"
        android:exported="false"
        android:label="@string/GalleryActivity_title"
        android:launchMode="singleTask" >
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.PlayMenuActivity"
        android:exported="false"
        android:label="@string/PlayMenuActivity_title" >
        <intent-filter>
            <action android:name=".PlayMenuActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.SettingsGlobalActivity"
        android:exported="false"
        android:label="@string/SettingsGlobalActivity_title" >
        <intent-filter>
            <action android:name=".SettingsGlobalActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.profile.ManageControllerProfilesActivity="false"
        android:label="@string/ManageControllerProfilesActivity_title" >
        <intent-filter>
            <action android:name=".profile.ManageControllerProfilesActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.profile.ControllerProfileActivity="false"
        android:label="@string/ControllerProfileActivity_title" >
        <intent-filter>
            <action android:name=".profile.ControllerProfileActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.profile.ManageEmulationProfilesActivity="false"
        android:label="@string/ManageEmulationProfilesActivity_title" >
        <intent-filter>
            <action android:name=".profile.ManageEmulationProfilesActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.profile.EmulationProfileActivity="false"
        android:label="@string/EmulationProfileActivity_title" >
        <intent-filter>
            <action android:name=".profile.EmulationProfileActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.profile.ManageTouchscreenProfilesActivity="false"
        android:label="@string/ManageTouchscreenProfilesActivity_title" >
        <intent-filter>
            <action android:name=".profile.ManageTouchscreenProfilesActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.profile.TouchscreenProfileActivity="false"
        android:label="@string/TouchscreenProfileActivity_title" >
        <intent-filter>
            <action android:name=".profile.TouchscreenProfileActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.input.DiagnosticActivity="false"
        android:label="@string/DiagnosticActivity_title" >
        <intent-filter>
            <action android:name=".input.DiagnosticActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.cheat.CheatEditorActivityanges="keyboardHidden|orientation|screenSize"
        android:label="@string/CheatEditorActivity_title" >
        <intent-filter>
            <action android:name=".cheat.CheatEditorActivity" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <!--
    For the GameActivities, do not restart the activity when the phone's slider
    opens or closes, or when the orientation (and thereby screen size) changes.
    This behavior is specified in android:configChanges below.
    -->
    <activity
        android:name="com.bytecode.n64emu4droid.GameActivity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:label="@string/GameActivity_title"
        android:theme="@style/appTheme.Black" >
    </activity>
    <activity
        android:name="com.bytecode.n64emu4droid.GameActivityXperiaPlay"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:label="@string/GameActivity_title"
        android:theme="@style/appTheme.Black" >
        <meta-data
            android:name="android.app.lib_name"
            android:value="xperia-touchpad" />
    </activity>

    <meta-data
        android:name="xperiaplayoptimized_content"
        android:resource="@drawable/hireslogo" />
    <meta-data
        android:name="game_display_name"
        android:resource="@string/app_name" />
    <meta-data
        android:name="game_icon"
        android:resource="@drawable/hireslogo" />
</application>

The error occurs at more then one location. Of them is:

android:name="com.bytecode.n64emu4droid.profile.ControllerProfileActivity="false"

Your manifest is slightly messed up. Sometimes you have android:name= followed by ="false" , which does not mean anything. My guess is that that false was referred to a android:exported attribute that somehow got lost.

So you should have:

android:name="name"
android:exported="false"

In a similar way, you have:

 android:name="com.bytecode.n64emu4droid.cheat.CheatEditorActivityanges="keyboardHidden|orientation|screenSize"

but I think that should be:

android:name="package.CheatEditorActivity"
android:configChanges="keyboardHidden|orientation|screenSize"

See here for allowed attributes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM