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


当前回答

我也遇到了同样的问题,我只是在我的manifest.xml中添加了一行,它为我工作了。

tools:replace="android:allowBackup,icon,theme,label,name"> 

将这一行添加到

<application
    android:name=".MyApplication"
    android:allowBackup="true"
    android:icon="@drawable/launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:screenOrientation="portrait"
    android:supportsRtl="true"
    android:theme="@style/AppThemecustom"
    tools:replace="android:allowBackup,icon,theme,label">

希望能有所帮助。

其他回答

我使用了FirebaseUI库和Facebook SDK库,这导致了我的问题。

implementation 'com.firebaseui:firebase-ui-database:0.4.4'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'

从[这里][1],我摆脱了这个问题。

随着FirebaseUI库的最新更新,之前版本的Facebook SDK也是其中的一部分。

如果你正在使用这两个库,请删除Facebook SDK库。

https://github.com/firebase/FirebaseUI-Android/issues/230

更新

从Android Studio 3.0及后续版本开始,app.gradle文件需要使用implementation或api而不是compile来添加应用程序的依赖项。

下面的黑客工作:

中添加xmlns:tools="http://schemas.android.com/tools"行 清单标签 添加 工具:取代= " android:图标,android:主题,android: allowBackup,标签,名称” 在应用程序标签中

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

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

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



//solution:use only one 

只需在您的项目清单应用程序标签中添加以下代码…

<application
        tools:node="replace">

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