Search code examples
android-studioandroidx

Migrate to AndroidX button in Android Studio is disabled when using buildSrc


After I changed my project to use buildSrc to better management dependencies

inside buildSrc/build.gradle.kts

plugins {
  `kotlin-dsl`
}

repositories {
   jcenter()
}

The problem is when we have to migrate to AndroidX the Refactor -> "Migrate to AndroidX..." button is disabled and after I remove buildSrc/build.gradle.kts the button is active Surprise!!! anyone know how to fix it?

enter image description here


Solution

  • My workaround is rollback all my build.gradle files to use plain text in dependencies, and restore it to use buildSrc again after migration