I am getting an warning in android studio when I run my app. the warning is-
Your project has set android.useAndroidX=true
, but configuration debugRuntimeClasspath
still contains legacy support libraries, which may cause runtime issues.
And a error-
Manifest merger failed with multiple errors, see logs
I checked my manifest file and there is no error in my manifest file. I tried debugging the app but it still doesn't fix. I am getting this after updating android studio from android studio arctic fox to android studio bumble bee which is recently released. I updated the gradle version tried cleaning project, invalidating caches but nothing worked. I increased the memory heap size and enabled multidex but still it is not fixed. Please help me out.
Your project has set `android.useAndroidX=true` but configuration `debugRuntimeClasspath` still contains legacy support libraries
Please review your project dependencies if they contain legacy libraries –
Alexaalexander
- Comment this line in settings.gradle
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
- Add this in build.gradle (project level):
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
- Add in gradle.properties:
android.enableJetifier=true
android.useAndroidX=true
still not working have any other solution?? –
Deem
For me, It worked with the line "android.enableJetifier=true" and by setting maven { url "jitpack.io" } in settings.gradle file. –
Kristlekristo
jcenter() is shot down since February 1, 2022 and can no longer be used. –
Exterminatory
Why do we need
Jitpack.io
here? –
Lanam I did same things without using
maven { url "https://jitpack.io" }
and it solved my problem –
Loop Add these in gradle.properties:
android.enableJetifier=true
android.useAndroidX=true
Sync your gradle
and Run the app. It worked fine for me and I didn't have to do the changes in setting.gradle
and build.gradle
(Project level) or any other files.
This worked fine and No needed to change anywhere else. –
Pincers
My solution is simialar to @JJ Smith one. But I didn't do anything to build.gradle
file. So:
- Comment this line in
setting.gradle
:
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
- Make sure you have these 2 lines in
gradle.properties
(if not add them or change them to true):
android.enableJetifier=true
android.useAndroidX=true
- Sync gradle
I DID NOT change the build.gradle
(at project level) file. I report it here just for the sake of completeness:
buildscript {
repositories {
google()
}
dependencies {
//...
}
}
plugins {
id 'com.android.application' version '7.2.0' apply false
id 'com.android.library' version '7.2.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Check if you the following dependency:
implementation 'com.android.support:multidex:1.0.3'
If you have it, just remove it. It worked for me.
Similar to Damien
Comment the line
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
and add
android.enableJetifier=true
android.useAndroidX=true
© 2022 - 2024 — McMap. All rights reserved.