Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: The plugin permission_handler_android requires Android SDK version 33

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?

like image 879
Roger Lipscombe Avatar asked Nov 16 '25 10:11

Roger Lipscombe


2 Answers

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_NOTIFICATIONS permission.

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:

  1. Change 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.
  2. Roll back to permission_handler 9.x, by editing pubspec.yaml as follows:
dependencies:
  ...
  permission_handler: ^9.2.0
  ...
like image 132
Roger Lipscombe Avatar answered Nov 19 '25 00:11

Roger Lipscombe


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

enter image description here

like image 45
Oscar Avatar answered Nov 18 '25 23:11

Oscar



Donate For Us

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