-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Platform version 16 is unsupported by this NDK. Please change minSdk to at least 21 to avoid undefined behavior." #1119
Comments
I can't reproduce this error. $ flutter --version
Flutter 3.22.0-0.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 87b652410d (13 days ago) • 2024-04-23 21:41:18 -0500
Engine • revision b4bfd45986
Tools • Dart 3.4.0 (build 3.4.0-282.3.beta) • DevTools 2.34.3
$ flutter create reproduce1119 --platform=android
$ cd reproduce1119
$ flutter pub add cronet_http
$ flutter run At least for a new project compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion The default values are defined here. I could change the Also, do you have |
Alternatively I could add Prior design doc about this by @dcharkes: http://flutter.dev/go/android-ndk-version |
The error is on Flutter beta and master channels, and the issue is they are now starting to warn that linking with NDK projects that are compatible with NDK versions lower than 21 may break things moving forward. It's an error, not a warning, and it stops the build unless you provide the specified override option to suppress it. No, providing |
In the meantime, a dirty hack to add in subprojects {
...
afterEvaluate { project ->
if (project.name.equalsIgnoreCase('jni')
&& project.hasProperty('android')) {
android {
defaultConfig {
minSdkVersion 21
}
}
}
}
} |
OK, I'll publish jni 0.9.2 with |
* Publish jni 0.9.2 and jnigen 0.9.1 * Close #1119
I upgraded Flutter to the most recent beta, and now
cronet_http
, which depends uponjni ^0.7.3
as a transitive dependency, causes my project to no longer build:These lines seem relevant:
https://github.com/dart-lang/native/blob/95d226d290d4d5c583c4e45b04048442f244c656/pkgs/jni/android/build.gradle#L59C1-L64C33
and
native/pkgs/jni/android/build.gradle
Line 87 in 95d226d
This needs to be bumped to 21 to solve the problem. (Also now
minSdkVersion
has becomeminSdk
.)The text was updated successfully, but these errors were encountered: