WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'

If you debug, it shows REASON: The Kotlin plugin is currently calling this API. We are working to solve this.

To see this error please run ./gradlew -Pandroid.debug.obsoleteApi=true --stacktrace


As tommyboy said, the Kotlin plugin is calling this deprecated API. If you don't want to get this warning while Kotlin is working on this, you can just use the previous version of Kotlin plugin like:

dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21"
}

It's probably a bug and fixed soon

You can revert back to the previous version or add this line to gradle.properties

android.debug.obsoleteApi=true