androidx has different version for the compile (1.0.0-rc01) and runtime (1.0.0) classpath
Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution
Android dependency 'androidx.lifecycle:lifecycle-runtime' has different version for the compile (2.0.0-rc01) and runtime (2.0.0) classpath.
If you are facing errors like above, chances are that you have androidx incompatibility issue in your project. Don't worry you can cure your project by reading this post. So, keep reading...
In a nutshell, Android used to provide support to previous versions of android using support libraries, then there many support libraries over the years. It created confusion in the minds of developers. AndroidX came to rescue, Android introduced a single library to all support libraries.
Now if you have support library code in your app or in a package you are using and you are also having AndroidX code in the same way then it created the incompability.
paste this above code in your 'gradle.properties' file.
}
paste this above code below 'dependencies' section in this 'build.gradle' file which is in the same folder as your 'gradle.properties' file.
Now run your project. What we have done is resolved the dependencies with our code.
Please comment below if this worked or didn't worked for you.
Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution
Android dependency 'androidx.lifecycle:lifecycle-runtime' has different version for the compile (2.0.0-rc01) and runtime (2.0.0) classpath.
INTRODUCTION
If you are facing errors like above, chances are that you have androidx incompatibility issue in your project. Don't worry you can cure your project by reading this post. So, keep reading...
What is Androidx and what is this incompatibility ?
In a nutshell, Android used to provide support to previous versions of android using support libraries, then there many support libraries over the years. It created confusion in the minds of developers. AndroidX came to rescue, Android introduced a single library to all support libraries.
Now if you have support library code in your app or in a package you are using and you are also having AndroidX code in the same way then it created the incompability.
How to resolve it ?
android.enableJetifier=true
android.useAndroidX=true
paste this above code in your 'gradle.properties' file.
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
}
}
paste this above code below 'dependencies' section in this 'build.gradle' file which is in the same folder as your 'gradle.properties' file.
Now run your project. What we have done is resolved the dependencies with our code.
Please comment below if this worked or didn't worked for you.
No comments:
Post a Comment