简体   繁体   中英

How can I solve these errors in AndroidManifest.xml?

I have changed something manually in my android manifest in one of the activities and now many lines of my manifest are in red在此处输入图像描述

I have errors like "Uri is not registered", "Attribute is not allowed here", etc.

This is the complete AndroidManifest.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>

you closed the MainActivity without the intent-filter

this is the solution

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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