Invoke-customs are only supported starting with Android O (–min-api 26)

因为更新sdk为28,要兼容,加入如下代码:

compileSdkVersion 28所以编译不兼容报错,
android {
    compileSdkVersion 28
    compileOptions{
        compileOptions {
            //加入下面这两句就好了
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }
    defaultConfig {
     
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
     
    }
    
}

 

你可能感兴趣的:(Android异常总结分类)