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

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

module的build.gradle里面内容



apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion rootProject.ext.android.compileSdkVersion
    buildToolsVersion rootProject.ext.android.androidSupportSdkVersion

    defaultConfig {
        minSdkVersion rootProject.ext.android.minSdkVersion
        targetSdkVersion rootProject.ext.android.targetSdkVersion
        versionCode rootProject.ext.android.versionCode
        versionName rootProject.ext.android.versionName
 

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.appcompat:appcompat:1.1.0'

    implementation rootProject.ext.dependencies["retrofit2"]
    implementation rootProject.ext.dependencies["converter-gson"]
    implementation rootProject.ext.dependencies["adapter-rxjava2"]
    implementation rootProject.ext.dependencies["rxjava2:rxandroid"]
    implementation rootProject.ext.dependencies["rxjava2"]
    implementation rootProject.ext.dependencies["logging-interceptor"]
    implementation rootProject.ext.dependencies["easypermission"]
}

 

解决方法:

修改根build.gradle的kotlin_verson = '1.3.31'改成

ext.kotlin_version = '1.3.40'

你可能感兴趣的:(kotlin,gradle,android,studio)