Setting SDK Version in Flutter by Modifying flutter.gradle
- Navigate to the flutter/packages/flutter_tools/gradle/.
- Use a text editor to open the flutter.gradle file located in the gradle folder.
- Inside the file, find and modify the compileSdkVersion, targetSdkVersion, and minSdkVersion to the desired API levels.
- 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