Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One or more plugins require a higher Android SDK version

erro : One or more plugins require a higher Android SDK version. Fix this issue by adding the following to D:\Flutter Project\ivy\android\app\build.gradle: android { compileSdkVersion 33 ... }

This is my app/build.gradle code

android {
compileSdkVersion 33
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.ivy"
    // You can update the following values to match your application needs.
    // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
    minSdkVersion flutter.minSdkVersion
    targetSdkVersion flutter.targetSdkVersion
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

Isn't it already fixed?

like image 395
littletree Avatar asked Sep 14 '26 13:09

littletree


1 Answers

compileSdkVersion 33
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

why are you using compileSdkVersion twice..? change it to this instead...

android {
compileSdkVersion 33
ndkVersion flutter.ndkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

You were over-riding the compileSdkVersion with flutter.compileSdkVersion

like image 85
Nikhil Avatar answered Sep 17 '26 06:09

Nikhil