Android Studio SDK的版本升级到28以后 出现
Error: Invoke-customs are only supported starting with Android O (--min-api 26)
解决:添加compileOptions
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.xq.mybreakpointdownload"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//添加
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}