I just started seeing the following warning when building my Flutter project:
Warning: The plugin permission_handler_android requires Android SDK version 33.
For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to C:\Users\roger\Source\choon\player\android\app\build.gradle:
android {
compileSdkVersion 33
...
}
My build.gradle contains the following:
android {
compileSdkVersion flutter.compileSdkVersion
...
What caused this, and how can I fix it?
This was caused by a recent change to the permission_handler plugin; see the Changelog:
BREAKING CHANGE: Updated Android compileSdkVersion to 33 to handle the new
POST_NOTIFICATIONSpermission.
The official Build Numbers only go up to API Level 32 (Android 12L), but apilevels.com shows that API Level 33 is Android 13 Beta.
You have two options:
compileSdkVersion flutter.compileSdkVersion to compileSdkVersion 33, which targets Android SDK 33. You can also do this by writing flutter.compileSdkVersion = 33 after the existing apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" line. At the time of this answer (Flutter 3.0.2), flutter.compileSdkVersion is 31.permission_handler 9.x, by editing pubspec.yaml as follows:dependencies:
...
permission_handler: ^9.2.0
...
In your flutter project under android directory, there exists two build.gradlefile. remember the build.gradle path is under the android/app/src directory, not the android/ directory, i have spend much time to the confirm the build.gradle path

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With