I upgraded my Android Studio to 3.2 and now I want to auto migrate to AndroidX using from Redactor
->Migrate to AndroidX
and now it has this error:
Android dependency 'androidx.media:media' has different version for the compile (1.0.0-rc01) and runtime (1.0.0) classpath. You should manually set the same version via DependencyResolution
Refactoring will change old imports to following:
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
You may want to use following instead if you do not plan to use legacy dependencies:
implementation 'androidx.appcompat:appcompat:1.0.0'
This will remove the issue as well if you are not using media at all...
Probably one of your dependencies uses androidx.media:media:1.0.0-rc1
. You should use Gradle's Dependency Resolution Strategy to force all dependencies to use the same version.
Try to add the following code in your app level build.gradle
and it should work.
Something like this:
android {
compileSdkVersion 28
defaultConfig {
// Your code
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
// Your build types if any
}
configurations.all {
resolutionStrategy {
force 'androidx.media:media:1.0.0'
}
}
}
You can also use this command to detect which of your dependencies uses androidx.media:media
:
./gradlew :app:dependencies
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