所以,我是一个Android和Java的初学者。我才刚刚开始学习。当我今天用Intent做实验时,我犯了一个错误。

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

我在这里找到了一些解决方案,并试图实施,但没有奏效。

这是我的身材。gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
    applicationId "com.example.rohan.petadoptionthing"
    minSdkVersion 10
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
}

这是我的AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>

package="com.example.rohan.petadoptionthing" > <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".Second" /> <activity android:name=".third"/> <activity android:name=".MainActivity"/> </application> This is my first week with coding, I am sorry if this is a really silly thing. I am really new to this and did not find any other place to ask. Sorry if I broke any rules


当前回答

如果你的项目瞄准的是Android 12,那么 在所有<activity>标签中添加<intent-filter>

android:exported="true/false"

其他回答

这是非常简单的错误,只有当你在mainifest.xml文件中定义任何活动调用两次时才会发生

<activity android:name="com.futuretech.mpboardexam.Game" ></activity>

//and launcher also------like that



//solution:use only one 

打开你的gradle控制台,然后你会看到gradle建议你添加特定的行(如:tools:replace="android:allowBackup"或tools:replace="android:label"等)。将这一行添加到您的清单文件下的标签和同步gradle,就是这样。

如上所示,只需迁移到Androidx,然后将最小sdk版本设置为26…毫无疑问,这是完美的

删除<activity android:name="。MainActivity"/>。正如你已经定义的那样:

 <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

Manifest文件显示歧义。

我在这个问题上遇到了一个奇怪的遭遇。当重命名变量名称为user_name时,我错误地将所有名称重命名为项目的user_name。所以我的xml标签<color name:"">变成<color user_name:"">同样适用于字符串,样式,清单。但是当我检查合并的清单时,它什么也没有显示,因为我只有一个清单,没有什么要找的。

因此,检查是否有任何格式错误的xml文件。