活动的Android清单重复注册

活动的Android清单重复注册,android,android-studio,android-manifest,Android,Android Studio,Android Manifest,我们决定为我们的应用程序制作一个介绍/欢迎屏幕。当用户第一次访问应用程序时,需要启动名为欢迎活动的活动。所有其他时间都需要启动主要活动。我在Android清单中就是这样做的: <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.google.android.gms.samples.vis

我们决定为我们的应用程序制作一个介绍/欢迎屏幕。当用户第一次访问应用程序时,需要启动名为欢迎活动的活动。所有其他时间都需要启动主要活动。我在Android清单中就是这样做的:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.android.gms.samples.vision.ocrreader"
android:installLocation="auto">

<uses-feature android:name="android.hardware.camera" />

<uses-permission android:name="android.permission.CAMERA" />

<application
    android:name=".OcrApplication"
    android:allowBackup="true"
    android:fullBackupContent="false"
    android:hardwareAccelerated="true"
    android:icon="@drawable/icon"
    android:label="Ingredient analysis"
    android:supportsRtl="true"
    android:theme="@style/Theme.AppCompat.NoActionBar">
    <meta-data
        android:name="com.google.android.gms.vision.DEPENDENCIES"
        android:value="ocr" />
    <activity android:name=".WelcomeActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main"
        android:windowSoftInputMode="stateHidden|adjustPan"
        android:exported="true"
        >
    </activity>
    <activity
        android:name=".OcrCaptureActivity"
        android:label="Read Text" />
    <activity android:name=".ListResult" />
    <activity android:name=".AllIngredients" />
    <activity android:name=".IngredientDescription" />
    <activity android:name=".Instruction" />
    <activity android:name=".WelcomeActivity">  </activity>
</application>

但是,此行中的活动存在错误-重复注册:


活动的重复注册
发生在同一活动注册两次时

在您的情况下,您已经注册了两次
WelcomeActivity
。一次紧跟在
标记之后,一次在最后

从mainfest的末尾删除以下重新注册行(在
标记之前)


当有相同的名称时,通常会出现此问题