Android 元素类型“活动”必须由匹配的结束标记“”终止
我一直在试图找出我的主文件出了什么问题。 无法修复它 有什么评论吗Android 元素类型“活动”必须由匹配的结束标记“”终止,android,xml,Android,Xml,我一直在试图找出我的主文件出了什么问题。 无法修复它 有什么评论吗 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="au.com.itview.shell"> <application android:allowBackup="true" android:icon="
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="au.com.itview.shell">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label=""
android:supportsRtl="true"/>
<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>
您正在使用开始标记本身中的/关闭应用程序标记。这样做:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label=""
android:supportsRtl="true">
问题是在活动之前关闭了应用程序标记。活动必须位于应用程序标记内 使用代码
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label=""
android:supportsRtl="true">
而不是
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label=""
android:supportsRtl="true"/>
标签标记中缺少应用程序名称这是清单文件中的错误
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="au.com.itview.shell">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="Your App Name"
android:supportsRtl="true"/>
<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>
为什么需要这样做?因为这个名字对应用程序列表中的用户是可见的,即android:label buddy。android:name是扩展应用程序类iff any的java类的路径。我还考虑了label而不是名称tagOh..这应该不是问题。我也发现了这个问题。你在我之前发表评论,,无论如何,我给出+1