3

I have been working on a flutter project for some time. Testing it on my android phone. But I could not test it due to an error

The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.core:core-ktx:1.7.0-alpha02. AAR metadata file: /Users/stanleychoo/.gradle/caches/transforms-2/files-2.1/319b6aa5138e91808960b0dab7b3c4f2/jetified-core-ktx-1.7.0-alpha02/META-INF/com/android/build/gradle/aar-metadata.properties

This is my build.gradle file

buildscript {
    ext.kotlin_version = '1.5.10'
    repositories {
        google()
        jcenter()
    }

    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        // ndkVersion = "20.1.5948944"
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath 'com.google.gms:google-services:4.3.5'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

configurations.all {
    resolutionStrategy {
        force 'androidx.core:core-ktx:1.7.0-alpha02'
    }
} 

Can i do anything to solve this issue? Thanks in advance

Stan
  • 131
  • 1
  • 8
  • 1
    i have personally changed the minCompileSdk in aar-metadata.properties from 31 to 30 but when i flutter run, it changes back to 31 – Stan Sep 03 '21 at 19:09
  • Have you checked this thread ? https://stackoverflow.com/questions/68207334/getting-error-while-running-react-native-run-android – esentis Sep 03 '21 at 19:16

0 Answers0