Setting SDK Version in Flutter by Modifying flutter.gradle

  1. Navigate to the flutter/packages/flutter_tools/gradle/.
  2. Use a text editor to open the flutter.gradle file located in the gradle folder.
  3. Inside the file, find and modify the compileSdkVersion, targetSdkVersion, and minSdkVersion to the desired API levels.
  4. After saving, run the following commands in your terminal to rebuild the Flutter app.


API levels

compileSdkVersion = 33
targetSdkVersion = 33
minSdkVersion = 21


commands

flutter clean
flutter pub get
flutter build <platform>  # e.g., flutter build apk