How do I add a final newline in my manifest.xml in Android Studio

2016-10-20 android xml android-studio

I get an error in my manifest.xml which I can't seem to solve. The error is:

Manifest file doesnt end with an final newline.

The error occures right before the last </application>.

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name=".MainMenu"
            android:theme="@android:style/Theme.Holo.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
               </activity>
          <activity android:name=".Difficulty"
             android:theme="@android:style/Theme.Holo.NoActionBar"
              />
           <activity android:name=".GameNormal"
               android:theme="@android:style/Theme.Holo.NoActionBar"
              />

        </application>

</manifest>

Answers

Click on the word with the red line (that causes the mentioned error), then click Alt+Enter and choose

Un-inject Language/Reference

You can also try to copy your manifest content, delete original manifest file and create new one like this :

enter image description here

Related