-
Notifications
You must be signed in to change notification settings - Fork 388
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
fix: Update minSdkVersion to 21 to Fix NDK Compatibility Issue #1832
Conversation
@baharudin-yusup Thanks for your contribution, can you share the |
Hi @littleGnAl, this error occurs when I use Gradle version 7 or higher, <project>/android/settings.gradle pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.4.1' apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
include ":app" <project>/android/build.gradle allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
configurations.configureEach {
exclude group: "io.agora.rtc", module: "full-screen-sharing"
} <project>/android/app/build.gradle plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 31
ndkVersion "26.1.10909125"
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "com.exapmple.app"
minSdkVersion 21
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
signingConfigs {
// ..
}
flavorDimensions "default"
productFlavors {
// ...
}
buildTypes {
// ...
}
aaptOptions {
noCompress 'tflite'
noCompress 'lite'
}
namespace 'com.exapmple.app'
}
flutter {
source '../..'
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
implementation 'androidx.window:window:1.3.0'
implementation 'androidx.window:window-java:1.3.0'
}
|
I think the issue is caused by the config of |
Facing a similar issue and it got solved by upgrading the minSDKVersion from 16 to safeExtGet('minSdkVersion', 24) in the ../.pub-cache/hosted/pub.dev/agora_rtc_engine-6.3.2/android/build.gradle file |
Facing the same issue here. After upgrading Gradle to 8.9 and AGP version to 8.7.0 through this guide: https://docs.flutter.dev/release/breaking-changes/android-java-gradle-migration-guide Getting the error A problem occurred configuring project ':agora_rtc_engine'.
As now https://docs.flutter.dev/reference/supported-platforms says minimum Flutter supported SDK is 21. |
I am also facing this issue. |
@iriya-kom have you got any solution? |
No, I think current fastest solution is to bring back Gradle version and try to build it. |
Sorry I'm still on vacation today, will follow up this issue tmr |
I tried downgrading the Java version, which is compatible with the previous gradle version. But, this causes gradle-java incompatibility issues. Tried, flutter clean, gradlew clean, invalidate caches & restart, etc., etc. resulting in no solution. |
@mehedi4958 @iriya-kom
|
I found the break changes notice here |
The change has merged into |
I am using it as a git package in my pubspec.yaml:
Still, the app build fails for android: `
` Please, help me out with this. |
Facing same error with gradle version 8.9 and AGP version 8.7 |
@mehedi4958 @rehan-505 |
The issue with the iris_method_channel is gone. When I use
The error is referenced from: |
@mehedi4958 I think the new problem is not related to the minSdkVersion, it should be related to the AGP version, can you please file a new issue for it? Thanks. |
Cover the customer's scenario #1832 (comment)
@mehedi4958 I updated the AGP and Gradle versions of our example, it works fine now, please upgrade the latest commit of the main branch and try again. |
Resolved. Thank you a bunch. |
Flutter 3.22 had dropped support for Android KitKat https://docs.flutter.dev/release/breaking-changes/android-kitkat-deprecation, update minSdkVersion to 21 to Fix NDK Compatibility Issue.
Cover the customer's scenario #1832 (comment)
Flutter 3.22 had dropped support for Android KitKat https://docs.flutter.dev/release/breaking-changes/android-kitkat-deprecation, update minSdkVersion to 21 to Fix NDK Compatibility Issue.
Cover the customer's scenario #1832 (comment)
Flutter 3.22 had dropped support for Android KitKat https://docs.flutter.dev/release/breaking-changes/android-kitkat-deprecation, update minSdkVersion to 21 to Fix NDK Compatibility Issue.
Cover the customer's scenario #1832 (comment)
Flutter 3.22 had dropped support for Android KitKat https://docs.flutter.dev/release/breaking-changes/android-kitkat-deprecation, update minSdkVersion to 21 to Fix NDK Compatibility Issue.
Cover the customer's scenario #1832 (comment)
This pull request addresses the error
com.android.builder.errors.EvalIssueException: [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.
by increasing the minSdkVersion from 16 to 21.