I am trying to compile a 6 months old code, but I get this error:
tools:replace specified at line:19 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 18 Error: Validation failed, exiting app main manifest (this file)
To fix this issue, I added the following line in my AndroidManifest.xml
tools:replace="android:appComponentFactory"
But now I got this error:
Manifest merger failed with multiple errors, see logs
When I googles this error, it asks me to remove that line from AndroidManifest.xml
that I added in first step. So, it's kind of a loop. How can I get rid of this.
My dependencies:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation files('libs/apache-mime4j-0.6 2.jar')
implementation files('libs/httpmime-4.0.1 .jar')
// this line must be included to integrate with Firebase
implementation 'com.hbb20:ccp:2.0.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.1.17'
implementation 'com.github.mukeshsolanki:country-picker-android:1.1.9'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.google.android.gms:play-services:10.2.1'
implementation 'com.google.maps.android:android-maps-utils:0.4'
implementation 'com.google.android.gms:play-services-location:10.2.1'
implementation 'com.google.code.gson:gson:2.4'
implementation 'com.airbnb.android:airmapview:1.3.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.github.jd-alexander:library:1.1.0'
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.gms:play-services-maps:10.2.1'
implementation 'com.google.android.gms:play-services-wallet:10.2.1'
implementation 'com.stripe:stripe-android:4.1.5'
implementation 'com.stripe:stripe-java:1.47.0'
implementation 'com.squareup.picasso:picasso:2.4.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.google.firebase:firebase-core:10.2.1'
implementation 'com.google.firebase:firebase-messaging:10.2.1'
implementation 'com.google.firebase:firebase-database:10.2.1'
implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
testImplementation 'junit:junit:4.12'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.1'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:mediarouter-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
}
Seems like you are having merger issues from another manifest file in your project. Many element names can appear several times in a manifest, such as multiple <uses-permission>
elements. Many of those have an identifier, usually android:name
, that distinguishes one from the next. In general, if two manifest sources both contribute the same element (i.e., same element name, same android:name value), those two elements are themselves merged, which means:
Sometimes, the default merger rules will not work to your satisfaction. In particular, when there are conflicts, the build will fail, and probably that is not a desired outcome.
To declare who wins in the case of conflicts, you can use tools:* attributes
in the manifest elements. Specifically:
tools:node
indicates how to resolve a conflicts between two editions of this particular XML element (e.g., an for the same android:name)tools:replace
indicates that certain attributes from a lower-priority edition of the manifest should be overwritten by their replacement values from a higher-priority edition of the manifesttools:remove
indicates that certain attributes from a lower-priority edition of the manifest should be removed entirelyEach of these, being in the tools namespace, will require you to have xmlns:tools="http://schemas.android.com/tools"
on the root element, if it is not there already. These attributes only affect the build tools and have no runtime implications, other than in terms of how the build tools build your app based on the tools attributes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With