所以,我是一个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


当前回答

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

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

其他回答

在我的情况下,我在清单文件的元数据标签中使用firebase vision Dependencies上的多个模型,所以我将它们混合在一个值参数中,它确实解决了我的问题。以下是如何做到的:

<meta-data
    android:name="com.google.mlkit.vision.DEPENDENCIES"
    android:value="ocr,langid"/>

我通过删除AndroidManifest.xml中的下面一行来解决这个问题

android:allowBackup="true"

如果在你添加了Android库模块之后,你会得到这个错误。 你可以通过简单地从android库模块的AndroidManifest.xml中删除android:label="@string/app_name"来修复它

我看到了答案,它们是完整的和有用的。无论如何,如果你正在完成Jetpack撰写测试代码实验室,并且在2021年底发现了这个错误,解决方案不是可接受的答案,你需要将目标sdk版本降低到30。

在app /构建。gradle,替换:

targetSdkVersion 31

:

targetSdkVersion 30

并再次运行Android测试

我的案子已经解决了

build.gradle(模块:应用)

defaultConfig {
----------
multiDexEnabled true
}
dependencies {
    ...........
    implementation 'com.google.android.gms:play-services-gcm:11.0.2'
    implementation 'com.onesignal:OneSignal:3.+@aar'
    }

这个答案转到OnSignal推送通知