如何解决错误:<intent-filter>在<manifest><application>



我的Android Manifest.xml中有一个错误我不知道我修改了什么。我想制作主题为theme.NoActionBar的主要活动,但有些东西已经取消了配置。它引发以下错误:在..中发现意外元素。

这是我的android manifest.xml文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dogsgame"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="30" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture" />
<supports-gl-texture android:name="GL_OES_compressed_paletted_texture" />
<application
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:debuggable="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:testOnly="true"
android:theme="@style/Theme.Dogsgame" >
<activity android:name="com.example.dogsgame.shop" />
<activity
android:name="com.example.dogsgame.backdog"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name="com.example.dogsgame.dogoutside"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name="com.example.dogsgame.dog"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name="com.example.dogsgame.choosedogs"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name="com.example.dogsgame.secondactivity"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name="com.example.dogsgame.MainActivity"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</application>

您应该像一样更改它

...
<activity
android:name="com.example.dogsgame.MainActivity"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

最新更新