littletree
littletree

Reputation: 55

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?

Upvotes: 3

Views: 6163

Answers (2)

Nikhil
Nikhil

Reputation: 315

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

Upvotes: 4

Himani
Himani

Reputation: 165

    android {
compileSdkVersion 33
compileSdkVersion flutter.compileSdkVersion //REMOVE THIS LINE
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
}

Upvotes: 0

Related Questions