FilePicker: Manifest merger failed
Describe the bug I received this bug when import the module from gradle.
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.1.0-alpha04] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:14:5-45:19 to override.
It seems this module use AndroidX in developing. Does there is a way to use this module without AndroidX ?
I have read the similar issue #22.
But the solution is not suitable to me.
To Reproduce Steps to reproduce the behavior:
- Add jaiselrahman:FilePicker to project
dependencies {
implementation 'com.github.jaiselrahman:FilePicker:1.2.2'
}
- Try build code to phone
Expected behavior A clear and concise description of what you expected to happen.
Screenshots Here is the merged Manifest.
Here is my project’s build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.30'
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is my app’s build.gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "......................."
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
buildscript {
ext.supportLibraryVersion = '28.0.0'
ext.butterknifeVersion = '8.8.1'
ext.glideVersion = '4.7.1'
ext.jdeferredVersion = '2.0.0-beta1'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.jakewharton:butterknife:$butterknifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterknifeVersion"
implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'org.immutables:gson:2.7.1'
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.9.0'
implementation "com.github.bumptech.glide:glide:$glideVersion"
kapt "com.github.bumptech.glide:compiler:$glideVersion"
implementation 'com.github.jaiselrahman:FilePicker:1.2.2'
implementation "org.jdeferred.v2:jdeferred-core:$jdeferredVersion"
implementation "org.jdeferred.v2:jdeferred-android:$jdeferredVersion"
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'
}
Android info (please complete the following information):
- Device/Emulator Nexus 5X (Android 8.1.0)
- API level 27
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 15 (7 by maintainers)
Great!
I found another way to solve the problem by using fork project. 😘 I fork the project and revert the commit 21c0bb975efb3adb955c40ff3f6e1128adc89596
then apply the new gradle dependencies with new jitpack path
Details is in here. https://github.com/j796160836/FilePicker/tree/master_without_androidx
It works like a charm.
You can use the older version
1.1.1, but if you have to use newer version you have to migrate to androidx.