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

 在\android\app\build.gradle中添加以下内容:

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8

    targetCompatibility JavaVersion.VERSION_1_8

}

如下:

android {
compileSdkVersion 27

lintOptions {
disable ‘InvalidPackage’
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.xyvod"
minSdkVersion 16
targetSdkVersion 27
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run –release` works.
signingConfig signingConfigs.debug
}
}
}

 

发表评论

您的电子邮箱地址不会被公开。