Android Manifest attribute “not allowed here” error fix

Today I created a new empty activity Android Kotlin project which created the AndroidManifest.xml as expected, but gave me errors around some of the application attributes not allowed here , e.g android:allowBackup

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

  <application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/Theme.AndroidDesignExplorer">
    <activity android:name=".MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

</manifest>

I was confused for a bit around why the automatically generated manifest file is giving me such error, but panic not – this is just a delay around the Project syncing. So simple solution :

Close AndroidManifest.xml

File -> Sync Project with Gradle Files

Open Manifest file again, and the errors should be gone.

Leave a comment