Skip to content

build(android): bump compile and target SDK to version 36 - #623

Merged
peterwgnd merged 2 commits into
masterfrom
build/android-api-36
Sep 15, 2026
Merged

peterwgnd merged 2 commits into
masterfrom
build/android-api-36

Conversation

@fortuna

@fortuna fortuna commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Bumps the Android build to API level 36 (Android 16):

-ANDROID_COMPILE_SDK_VERSION=35
-ANDROID_BUILD_TOOLS_VERSION=35.0.0
+ANDROID_COMPILE_SDK_VERSION=36
+ANDROID_BUILD_TOOLS_VERSION=36.0.0

 ANDROID_MIN_SDK_VERSION=21
-ANDROID_TARGET_SDK_VERSION=35
+ANDROID_TARGET_SDK_VERSION=36

This mirrors #603 (the 34 -> 35 bump), which was also a gradle.properties-only change.

Why no code changes are needed

I went through the Android 16 behavior changes that apply to apps targeting SDK 36
and checked each against this app:

Behavior change Applies to Intra?
Edge-to-edge opt-out (windowOptOutEdgeToEdgeEnforcement) removed No — the app never used the opt-out, so it has been edge-to-edge since targetSdk 35. The root layouts already use android:fitsSystemWindows="true".
Orientation / resizability restrictions ignored on large screens No — the manifest declares no screenOrientation, resizeableActivity or maxAspectRatio.
Stricter JobScheduler quotas No — the app uses a foreground service, not JobScheduler.
Predictive back defaults No change — already the default at targetSdk 35.
16 KB page alignment Already handled in #604 / #609.

Verification

Run locally with JDK 17 and SDK platform 36 / build-tools 36.0.0:

  • ./gradlew assembleDebug — BUILD SUCCESSFUL (Go backend AAR rebuilt via gomobile bind)
  • ./gradlew test — BUILD SUCCESSFUL

Follow-ups, now handled elsewhere in the stack

Bumping compileSdk to 36 surfaced one new lint error, MissingPermission for
USE_FULL_SCREEN_INTENT on the VPN-revoked notification. That turned out to be a real
bug rather than just a lint complaint, and is fixed in the second commit here.

AGP 8.5.1 also warned that it was only tested up to compileSdk 34. That is fixed by
#626, which upgrades AGP to 9.4.0.

Note that ./gradlew lintDebug already fails on master with three pre-existing
errors (StartActivityAndCollapseDeprecated, RestrictedApi,
QueryAllPackagesPermission). This PR does not add to them. CI only runs go test.

@fortuna
fortuna added this pull request to stack #624 September 15, 2026 16:57
Base automatically changed from docs/agents-md to master September 15, 2026 16:57
@fortuna
fortuna force-pushed the build/android-api-36 branch from 1d1f5b9 to 8c8b54e Compare September 15, 2026 16:57
Targets Android 16 (API 36) for Play Store compliance, following the
same pattern as the previous bump to API 35 (#603).

The app declares no edge-to-edge opt-out, no orientation or
resizability restrictions and does not use JobScheduler, so none of
the Android 16 targeting behavior changes require code changes.
Verified with ./gradlew assembleDebug and ./gradlew test.
@fortuna
fortuna force-pushed the build/android-api-36 branch from 8c8b54e to dd65a5b Compare September 15, 2026 16:58
The revocation warning used a full-screen intent to jump straight into
the main UI. That stopped working long ago: Android 10 restricts
background activity starts, and Android 14 only grants
USE_FULL_SCREEN_INTENT to calling and alarm apps, so the system
downgrades the notification to a heads-up notification. Because no
content intent was ever set, the warning could not be tapped at all.

Use a content intent instead, which opens the main UI on every
supported version and does not need a permission this app is not
eligible for. This also resolves the MissingPermission lint error that
compileSdk 36 surfaces.

@peterwgnd peterwgnd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@peterwgnd
peterwgnd merged commit 3d26924 into master Sep 15, 2026
12 checks passed
@peterwgnd
peterwgnd deleted the build/android-api-36 branch September 15, 2026 18:17
fortuna added a commit that referenced this pull request Sep 15, 2026
MainActivity overrode onBackPressed() to return to the home view from the
settings and info screens. Apps targeting SDK 36 can no longer opt out of
predictive back, and the platform now routes back gestures through
OnBackPressedDispatcher instead of calling onBackPressed(), so back was
leaving the app instead of returning home. Lint flags this as
GestureBackNavigation, and only at targetSdk 36 -- the bump in #623 is what
introduced the regression.

Replace the override with an OnBackPressedCallback registered on the
dispatcher. The callback is enabled only while a non-home view is showing,
mirroring the existing up-arrow logic in chooseView(), so back still exits
the app from the home view. isShowingHomeView() is now unused and removed.

This needs androidx.activity 1.6+ to bridge the platform callback; the
pinned appcompat 1.4.0 only brings in activity 1.2.4. Upgrade appcompat to
1.7.1, which pulls activity 1.8.0 and still supports minSdk 21. Deliberately
not 1.8.0, which would require raising minSdk to 23.
fortuna added a commit that referenced this pull request Sep 15, 2026
MainActivity overrode onBackPressed() to return to the home view from the
settings and info screens. Apps targeting SDK 36 can no longer opt out of
predictive back, and the platform now routes back gestures through
OnBackPressedDispatcher instead of calling onBackPressed(), so back was
leaving the app instead of returning home. Lint flags this as
GestureBackNavigation, and only at targetSdk 36 -- the bump in #623 is what
introduced the regression.

Replace the override with an OnBackPressedCallback registered on the
dispatcher. The callback is enabled only while a non-home view is showing,
mirroring the existing up-arrow logic in chooseView(), so back still exits
the app from the home view. isShowingHomeView() is now unused and removed.

This needs androidx.activity 1.6+ to bridge the platform callback; the
pinned appcompat 1.4.0 only brings in activity 1.2.4. Upgrade appcompat to
1.7.1, which pulls activity 1.8.0 and still supports minSdk 21. Deliberately
not 1.8.0, which would require raising minSdk to 23.
fortuna added a commit that referenced this pull request Sep 15, 2026
MainActivity overrode onBackPressed() to return to the home view from the
settings and info screens. Apps targeting SDK 36 can no longer opt out of
predictive back, and the platform now routes back gestures through
OnBackPressedDispatcher instead of calling onBackPressed(), so back was
leaving the app instead of returning home. Lint flags this as
GestureBackNavigation, and only at targetSdk 36 -- the bump in #623 is what
introduced the regression.

Replace the override with an OnBackPressedCallback registered on the
dispatcher. The callback is enabled only while a non-home view is showing,
mirroring the existing up-arrow logic in chooseView(), so back still exits
the app from the home view. isShowingHomeView() is now unused and removed.

This needs androidx.activity 1.6+ to bridge the platform callback; the
pinned appcompat 1.4.0 only brings in activity 1.2.4. Upgrade appcompat to
1.7.1, which pulls activity 1.8.0 and still supports minSdk 21. Deliberately
not 1.8.0, which would require raising minSdk to 23.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants