I recently got a warning in the Google Play Console that my API level is too low for my Flutter app.
Deadline: Aug 30, 2024
Violation: App must target Android 14 (API level 34) or higher
When I look in /android/app/build.gradle
I have these default settings related to my API version:
defaultConfig {
applicationId "..."
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
Where do flutter.minSdkVersion
and flutter.targetSdkVersion
get set? I consulted these docs and didn’t find anything. My first thought is that it would be in pubspec.yaml
, but I’ve never had anything related to the Android API version in there.
Do I have to manually set the values, or is there a way to set it via a Flutter configuration?
defaultConfig {
applicationId "..."
minSdkVersion 14 //<-- Set manually
targetSdkVersion 34 //<-- Set manually
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}