eugene
eugene

Reputation: 41665

Android Studio, Unable to migrate to AndroidX

I'm having the following error message when trying to do refactor -> migrate to AndroidX

The gradle plugin version in your project build.gradle file needs to be set to at least com.android.tools.build:gradle:3.2.0 in order to migrate to AndroidX

Although I have version higher specified in build.gradle...

app/android/build.gradle

buildscript {
 dependencies {
    classpath 'com.android.tools.build:gradle:3.4.2'

I have another app/android/app/build.gradle.

enter image description here enter image description here

Upvotes: 3

Views: 1473

Answers (3)

yancaico
yancaico

Reputation: 1261

Only change gradle version of a project may be not enough. Please also check gadle versions of the dependies. Make sure every gradle version of a depency is beyond 3.2.0. Have a try, please.

Upvotes: 0

Xianwei
Xianwei

Reputation: 2551

in my case, apply classpath("com.android.tools.build:gradle:4.0.1")

instead of classpath("com.android.tools.build:gradle:${version.gralde}") -> even version.gralde is 4.0.1

:thinking :) maybe android studio can't identity the plugin version if it references to an external value

Upvotes: 0

eugene
eugene

Reputation: 41665

I solved it by changing version to 3.4.1 and back to 3.4.2. now error is gone..

Upvotes: 1

Related Questions