5

The error says that "Error:Execution failed for task ':app:processDebugManifest'. > " I have tried many solutions on this website but still, the problem is not solved. Please help me

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="project.myapp">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:appComponentFactory">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

build.gradle(Module:app)

apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "project.myapp"
        minSdkVersion 21
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
//    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.firebase:firebase-database:11.0.4'
    implementation 'com.google.firebase:firebase-auth:11.0.4'
    implementation 'com.google.firebase:firebase-storage:11.0.4'
    implementation 'com.firebaseui:firebase-ui-firestore:3.0.0'
    implementation 'de.hdodenhof:circleimageview:2.0.0'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.jakewharton:butterknife:10.1.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'

build.gradle(Project:myapp)

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.0'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

On Merged Manifest says that

Merging Errors: Error: tools:replace specified at line:5 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 4 Error: Validation failed, exiting app main manifest (this file)

bagassprtm
  • 55
  • 1
  • 1
  • 5

7 Answers7

5

For me, the solution was to just migrate to AndroidX.

On Android Studio, go to:

Refactor > Migrate to AndroidX

clean the project.

coderpc
  • 4,119
  • 6
  • 51
  • 93
Maher
  • 342
  • 3
  • 10
  • 1
    Worked like charm. I was struggling with importing the Ionic app project to Android Studio 3.6. Your answer helped. – coderpc Mar 09 '20 at 02:21
2

I.m delete this

  • tools:ignore="GoogleAppIndexingWarning",
  • tools:replace="android:appComponentFactory"

and fix this problem.good luck :)

2

Just remove the below line:

tools:replace="android:appComponentFactory"

And recompile and finally it works for me!

Kerelos
  • 83
  • 4
1

you should try this:

1:Remove tools:replace="android:appComponentFactory"

2:Provide new value for android:appComponentFactory" attribute

from: Manifest merger failed, error on compiling

it worked for me!

Ricardinho
  • 599
  • 9
  • 22
1

solve my problem

Refactor > Migrate to AndroidX

Bin Khanjar
  • 87
  • 1
  • 4
0

In my case an error in Manifest file brought about this error at the time of generating apk although app was building flawlessly.

It was want of explicit 'exported' attribute in activity elements in Manifest file. after that apk too generated successfully .

Naveed I
  • 21
  • 3
0

I had a similar issue and I have solved by updating Junit dependency from 1.1.3 or later and it solved my problem.

androidTestImplementation "androidx.test.ext:junit:1.1.3"
Nikunj Patel
  • 321
  • 4
  • 5