简体   繁体   English

如何在 Android Studio 的 manifest.xml 中添加最后的换行符

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

I get an error in my manifest.xml which I can't seem to solve.我的manifest.xml中出现错误,我似乎无法解决。 The error is:错误是:

Manifest file doesnt end with an final newline.

The error occures right before the last </application> .错误发生在最后一个</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>

Click on the word with the red line (that causes the mentioned error), then click Alt+Enter and choose单击带有红线的单词(导致上述错误),然后单击 Alt+Enter 并选择

Un-inject Language/Reference

You can also try to copy your manifest content, delete original manifest file and create new one like this :您还可以尝试复制清单内容,删除原始清单文件并创建新的清单文件,如下所示:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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