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


当前回答

我也面临着这个错误。在构建日志中,最后一行是“编译值文件失败”。

因此,如果你面临同样的问题,那么只需在gradle中添加下面的行。属性文件很可能会修复这个问题。

android.enableJetifier=true

我的意思是它修复了Manifest合并失败的Android Studio错误。

其他回答

最小sdk版本应该与您正在使用的模块/lib相同 例如:你的模块的最小sdk版本是26,你的应用程序的最小sdk版本是21。

这是因为您正在使用新的材料库和遗留的支持库。

你必须迁移android。为了使用com.google.android.material,支持androidx。

如果你使用的是android studio v 3.2或更高版本,简单

去refactor——>迁移到ANDROID X。

一定要备份你的项目。

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

作为Android Studio的新手,在我的情况下,我已经将一个现有的项目从Eclipse移动到Android Studio,并发现在我的Manifest.xml中有一个重复的活动定义,而Eclipse没有拾取它,这显示为一个Gradle错误。

我在Gradle控制台(屏幕右下角)找到了这一点。

在我的例子中,它显示了一个错误,因为<uses-permission>元素中有冗余。 因此,请在AndroidManifest.xml文件中检查相同的内容。

Android Studio版本为3.0.1

操作系统为Windows 7

这里是截图供参考。