flutter - flutter_libserialport 0.5.0 Build failed SDKVersions suppressError=21 - Stack Overflow

I have this error:FAILURE: Build failed with an exception.What went wrong:A problem occurred configur

I have this error:

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':flutter_libserialport'.

[CXX1110] Platform version 16 is unsupported by this NDK. Please change minSdk to at least 21 to avoid undefined behavior. To suppress this error, add android.ndk.suppressMinSdkVersionError=21 to the project's gradle.properties or set android.experimentalProperties["android.ndk.suppressMinSdkVersionError"]=21 in the Gradle build file.

Here is the build.gradle.kts:

defaultConfig {
    applicationId = "com.example.appli2"
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode
    versionName = flutter.versionName
}

and local properties:

sdk.dir=C:\\Users\\xxx\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\SRC\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1

I tried to change minSdk =21, but no success.

I have this error:

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':flutter_libserialport'.

[CXX1110] Platform version 16 is unsupported by this NDK. Please change minSdk to at least 21 to avoid undefined behavior. To suppress this error, add android.ndk.suppressMinSdkVersionError=21 to the project's gradle.properties or set android.experimentalProperties["android.ndk.suppressMinSdkVersionError"]=21 in the Gradle build file.

Here is the build.gradle.kts:

defaultConfig {
    applicationId = "com.example.appli2"
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode
    versionName = flutter.versionName
}

and local properties:

sdk.dir=C:\\Users\\xxx\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\SRC\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1

I tried to change minSdk =21, but no success.

Share Improve this question edited Mar 5 at 12:04 NotTheDr01ds 21.3k7 gold badges60 silver badges91 bronze badges asked Mar 2 at 14:40 user29858490user29858490 1
Add a comment  | 

1 Answer 1

Reset to default 0

I did this ... Works fine

.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
    android.useAndroidX=true
    android.enableJetifier=true
    // new add 
    android.ndk.suppressMinSdkVersionError=21 

Thanks

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745120092a4612362.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信