user2465510 user2465510 - 1 year ago 51
Android Question

Unbound prefix in first line of Android XML

I don't know much XML. All except the uses-permission line was computer-generated with the AIDE mobile IDE.

It was working fine before I think I must have accidentally deleted something. Now it is saying there is an "unbound prefix" on the first line. I've gone through other answers on here, though, and all XML manifests seem to have the exact same first line as I do.

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

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

android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

Answer Source

Here's a corrected Manifest for you

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

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>