Repository navigation
fix(android): lower compileSdk to 36 and use literal constants for API 37 - #1588
Draft
vishnuprasad0 wants to merge 1 commit into
Draft
vishnuprasad0 wants to merge 1 commit into
vishnuprasad0 wants to merge 1 commit into
Conversation
…I 37
Lower compileSdk from 37 to 36 in permission_handler_android and example apps,
replacing Manifest.permission.ACCESS_LOCAL_NETWORK and Build.VERSION_CODES.CINNAMON_BUN
with their literal values ('android.permission.ACCESS_LOCAL_NETWORK' and 37).
This resolves the inability of consumers to compile due to missing 'android-37'
SDK platform and lack of minor-versioned platform resolution in released AGP,
while preserving identical runtime behavior on Android 17 devices.
Fixes Baseflow#1556
Co-Authored-By: Claude <noreply@anthropic.com>
vishnuprasad0
marked this pull request as draft
November 18, 2026 13:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1556.
permission_handler_androidsetscompileSdk = 37, and that doesn't build. Android 17 installs itsplatform as
android-37.0, but AGP asks for the hash stringandroid-37and doesn't find it. Thisdrops
compileSdkback to 36 and uses literals for the two API-37-only symbols. Runtime behaviouris unchanged.
I ran the same build on both branches, same machine, same command. On
mainthe toolchain installsthe platform itself and the build still fails, so it isn't a missing SDK on my side:
On this branch it builds:
√ Built build/app/outputs/flutter-apk/app-debug.apk.Both runs needed
--android-skip-build-dependency-validation, because this example's Gradle wrapperis 9.1.0 and Flutter now wants 9.3.1. That's unrelated to this change and I used the flag on both
sides so the comparison is fair.
The permission string is the part worth double-checking, since
hasPermissionInManifestcomparesstrings and a typo would silently disable the permission on Android 17. I took
"android.permission.ACCESS_LOCAL_NETWORK"from the Android reference, where it's listed as theconstant value and added in API 37.
CINNAMON_BUNbecomes a private= 37constant with a commentsaying why.
Two things you should know before reviewing. First, literals aren't the only fix — bumping AGP to a
version that resolves
android-37.0would letcompileSdk = 37stay, and avoid carrying literalsthat go stale once API 37 tooling is normal. I picked the smaller change because it unblocks people
today, but if you'd rather fix it at the AGP level I'll redo it, or close this for your own fix.
Second, nothing in
jvm-testscovers theACCESS_LOCAL_NETWORKmapping, so no test guards thatliteral. The existing JVM tests don't touch
hasPermissionInManifestat all, and wiring that uplooked bigger than this fix deserves — happy to add it if you want it in scope.
flutter build apk --debugonpermission_handler_android/example, output above)pubspec.yamlwith an appropriate new version according to the pub versioning philosophy. (permission_handler_android14.1.1 -> 14.1.2; the app-facing package's^14.1.0already resolves to it)CHANGELOG.mdto add a description of the change.///). (no public Dart API changed; the Java constants carry comments, andANDROID_PERMANENTLY_DENIED_FIX_GUIDE.mdno longer tells readers to usecompileSdk 37)main.dart format .and committed any changes.flutter analyzeand fixed any errors. (remaining infos are the repo-wide Flutter 3.50material.dartdeprecation in the example apps, which also fails CI on unrelated PRs like fix(apple): deliver requestPermissions result on the main queue #1587)