Is there an existing issue for this?
Affected platform(s)
Old behavior
With permission_handler_android 13.x (compileSdkVersion 35), an app compiling against compileSdk 36 built fine.
Current behavior
permission_handler_android 14.0.0 raised compileSdkVersion from 35 straight to 37, and requires every consumer to do the same:
BREAKING CHANGES: When updating to version 14.0.0 make sure to also set the compileSdkVersion in the app/build.gradle file to 37.
That requirement currently cannot be satisfied by anyone, for two independent reasons.
1. There is no android-37 SDK platform to install. Android now publishes minor API versions, and API 37 ships as android-37.0, not android-37:
$ sdkmanager --list | grep 'platforms;android-3[5-9]'
platforms;android-35 | 2 | Android SDK Platform 35
platforms;android-36 | 2 | Android SDK Platform 36
platforms;android-36.1 | 1 | Android SDK Platform 36.1
platforms;android-37.0 | 2 | Android SDK Platform 37.0
$ sdkmanager "platforms;android-37"
Warning: Failed to find package 'platforms;android-37'
AGP resolves compileSdk = 37 to the hash string android-37, so even with android-37.0 installed the build fails:
Could not determine the dependencies of task ':permission_handler_android:compileDebugJavaWithJavac'.
> Failed to find target with hash string 'android-37' in: /home/user/Android/Sdk
2. No released AGP supports compileSdk 37. AGP 9.0.1, the latest stable, rejects it:
Execution failed for task ':app:checkDebugAarMetadata'.
> An issue was found when checking AAR metadata:
1. Dependency ':permission_handler_android' requires libraries and applications that
depend on it to compile against version 37 or later of the Android APIs.
:app is currently compiled against android-36.
Also, the maximum recommended compile SDK version for Android Gradle
plugin 9.0.1 is 36.
So the plugin asks for an SDK level that (a) is not published under that name and (b) is above what the newest AGP supports. Every app that resolves to 14.0.0 — which is everyone on permission_handler: ^13.0.1, since it allows permission_handler_android: ^14.0.0 — cannot build for Android at all.
Steps to reproduce
flutter create repro && cd repro
flutter pub add permission_handler (resolves permission_handler_android 14.0.0)
flutter build apk --debug
- The build fails at
:app:checkDebugAarMetadata with the message above.
- Setting
compileSdk = 37 in android/app/build.gradle.kts does not help — it then fails earlier, at Failed to find target with hash string 'android-37'.
Things I tried that do not work
sdkmanager "platforms;android-37" — the package does not exist; only platforms;android-37.0 does.
- Installing
platforms;android-37.0 — AGP still looks for android-37.
- Pinning only
permission_handler_android: ">=13.0.0 <14.0.0" — permission_handler: ^13.0.1 requires ^14.0.0, so the solver refuses.
- Capping the plugin's
compileSdk back to 36 from the root build.gradle.kts via subprojects { ... } — the plugin itself then compiles, but checkDebugAarMetadata still rejects the app, because the AAR metadata records the 37 requirement.
Workaround
Downgrade the umbrella package, which pulls permission_handler_android 13.x:
permission_handler: ^12.0.3
Suggested fix
Declare compileSdk = 36 in permission_handler_android until an AGP release actually supports API 37 — or, if something in the plugin genuinely needs API 37, declare it in the form AGP can resolve once that support lands (compileSdk = 37 plus compileSdkMinor = 0, matching the published android-37.0 package).
As a data point, 13.x to 14.0.0 skipped API 36 entirely (35 to 37), so simply targeting 36 would still be a step forward and would build everywhere today.
Possibly related: #1531 ([Android] AGP 9 / built-in Kotlin compatibility).
Version info
|
|
| permission_handler |
13.0.1 (resolves permission_handler_android 14.0.0, published 2026-07-31) |
| Flutter |
3.44.6 (stable) |
| Dart |
3.12.2 |
| Android Gradle Plugin |
9.0.1 |
| Gradle |
9.1.0 |
App compileSdk |
36 (flutter.compileSdkVersion) |
| Host OS |
Linux |
Is there an existing issue for this?
Affected platform(s)
Old behavior
With
permission_handler_android13.x (compileSdkVersion 35), an app compiling againstcompileSdk 36built fine.Current behavior
permission_handler_android14.0.0 raisedcompileSdkVersionfrom 35 straight to 37, and requires every consumer to do the same:That requirement currently cannot be satisfied by anyone, for two independent reasons.
1. There is no
android-37SDK platform to install. Android now publishes minor API versions, and API 37 ships asandroid-37.0, notandroid-37:AGP resolves
compileSdk = 37to the hash stringandroid-37, so even withandroid-37.0installed the build fails:2. No released AGP supports compileSdk 37. AGP 9.0.1, the latest stable, rejects it:
So the plugin asks for an SDK level that (a) is not published under that name and (b) is above what the newest AGP supports. Every app that resolves to 14.0.0 — which is everyone on
permission_handler: ^13.0.1, since it allowspermission_handler_android: ^14.0.0— cannot build for Android at all.Steps to reproduce
flutter create repro && cd reproflutter pub add permission_handler(resolvespermission_handler_android14.0.0)flutter build apk --debug:app:checkDebugAarMetadatawith the message above.compileSdk = 37inandroid/app/build.gradle.ktsdoes not help — it then fails earlier, atFailed to find target with hash string 'android-37'.Things I tried that do not work
sdkmanager "platforms;android-37"— the package does not exist; onlyplatforms;android-37.0does.platforms;android-37.0— AGP still looks forandroid-37.permission_handler_android: ">=13.0.0 <14.0.0"—permission_handler: ^13.0.1requires^14.0.0, so the solver refuses.compileSdkback to 36 from the rootbuild.gradle.ktsviasubprojects { ... }— the plugin itself then compiles, butcheckDebugAarMetadatastill rejects the app, because the AAR metadata records the 37 requirement.Workaround
Downgrade the umbrella package, which pulls
permission_handler_android13.x:Suggested fix
Declare
compileSdk = 36inpermission_handler_androiduntil an AGP release actually supports API 37 — or, if something in the plugin genuinely needs API 37, declare it in the form AGP can resolve once that support lands (compileSdk = 37pluscompileSdkMinor = 0, matching the publishedandroid-37.0package).As a data point, 13.x to 14.0.0 skipped API 36 entirely (35 to 37), so simply targeting 36 would still be a step forward and would build everywhere today.
Possibly related: #1531 ([Android] AGP 9 / built-in Kotlin compatibility).
Version info
permission_handler_android14.0.0, published 2026-07-31)compileSdkflutter.compileSdkVersion)