[PR-27228] Upgrade Demo App target to Android 17 (API 37) - #16
Conversation
Google Play requires target API >= 36 by Aug 31, 2026. Target 37 (latest stable, June 2026) so the app also clears the Aug 2027 deadline. App module only: compileSdk/targetSdk 35 -> 37, versionCode 4. The SDK library's public contract is unchanged (compileSdk 35, minSdk 16, v0.5.14) since the Play policy applies only to the uploaded app binary. Toolchain cascade required by compileSdk 37: AGP 8.5.2 -> 9.3.0, Gradle 8.7 -> 9.5.0, build-tools 37.0.0, unmock 0.7.8 -> 0.11.0, Groovy DSL migration (AGP 9 removed the old names; '=' assignment replaces the Gradle-10-removed space syntax), buildFeatures.buildConfig replaces the removed gradle.properties flag, CI image bump, jitpack.yml pins JDK 17 so JitPack tag builds survive Gradle 9.
- AGP 9 rejects getDefaultProguardFile('proguard-android.txt'); switch
both modules to proguard-android-optimize.txt (inert while
minifyEnabled = false).
- SDK unit tests: PowerMock 1.6.6/Mockito 1.10.19 cannot run on
JDK 17+ (module encapsulation), broken since CI dropped the Java 8
pin. Upgrade to PowerMock 2.0.9 / Mockito 2.28.2 (test-only deps)
and open the JDK modules the mocking stack and OkHttp reflect into.
Full :sdk:test suite passes on JDK 21 with Gradle 9.5/AGP 9.3.
zhuravel
left a comment
There was a problem hiding this comment.
Reviewed the complete PR-only diff against master at e0b9c1f. The AGP/Gradle migration and focused builds pass, but the target-SDK bump activates one material Back-navigation regression in the Talkable offer flow. Requesting the inline fix before merge.
| app_compile_sdk=35 | ||
| app_target_sdk=35 | ||
| app_compile_sdk=37 | ||
| app_target_sdk=37 |
There was a problem hiding this comment.
[P2] Migrate custom Back handling before targeting 37
Plain English
On Android 16 and newer, pressing Back while a Talkable popup is open skips the popup-closing behavior and leaves the offer screen instead.
Example
Run the demo on Android 16 or 17, open a Talkable offer and then an in-offer popup, and press system Back. This line raises the app target from 35 to 37, so the platform no longer dispatches TalkableActivity.onBackPressed(). As a result, TalkableOfferFragment.onBackPressed() never publishes close_popups, and the activity follows the default Back action. Android documents this target-36+ change here: behavior changes.
Why this matters
The demo now activates this behavior, and SDK consumers targeting 36 or newer encounter the same broken popup interaction.
Suggested fix
Migrate TalkableActivity to OnBackPressedDispatcher / OnBackPressedCallback and ensure the resolved AndroidX Activity version integrates with predictive Back. For example:
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
if (!mTalkableOfferFragment.onBackPressed()) {
finish();
}
}
});Add an Android 16+ device or instrumentation test that opens a popup and verifies that the first Back action closes it. A manifest opt-out is only a temporary fallback.
There was a problem hiding this comment.
Good catch — confirmed: TalkableActivity's Back override stops being dispatched once the app targets 36+. Fixed for the demo app in 372e8a6 with the documented enableOnBackInvokedCallback="false" opt-out. The proper OnBackPressedDispatcher migration needs androidx.activity ≥ 1.6.0 in the SDK (the dispatcher only integrates with predictive back from 1.6.0), so it comes with an AndroidX bump and an SDK release — tracked as a follow-up rather than in this PR, which intentionally doesn't change the published SDK.
Targeting API 36+ enables predictive back by default: onBackPressed() is no longer dispatched, so TalkableActivity's popup-closing Back override stops working. Opt out at the application level per https://developer.android.com/about/versions/16/behavior-changes-16#predictive-back until the SDK migrates to OnBackPressedDispatcher (requires androidx.activity >= 1.6.0 and an SDK release; tracked separately).
zhuravel
left a comment
There was a problem hiding this comment.
1 problem blocks this PR.
Reviewed master@289b35f -> upgrade-api-37@372e8a6 only.
P2The toolchain upgrade has no active CI check.
Checks
git diff --check- passed.- GitHub PR checks - none reported; Actions are disabled and no workflows exist.
- Gradle build - not run: this host has no Java or Android SDK, and the repository has no active CI.
| username: $DOCKERHUB_USERNAME | ||
| password: $DOCKERHUB_ACCESS_TOKEN | ||
| image: cimg/android:2024.01.1 | ||
| image: cimg/android:2026.07.1 |
There was a problem hiding this comment.
[P2] Run the upgrade in the active CI
This edit only updates retired CircleCI configuration. GitHub reports no checks for this head. This repository has no workflows, and Actions are disabled. The AGP 9.3 and Gradle 9.5 migration can merge without :sdk:test or a demo build running.
Reproduce
- Push this branch.
- Open the PR checks.
- No build or test check appears.
Fix
Move the JDK 17+, API 37, and Gradle task changes into the current GitHub Actions pipeline. Make that pipeline report a required PR check. Run :sdk:test and a demo build there. Remove this dead CircleCI edit.
Why
Google Play requires apps to target API 36+ by Aug 31, 2026 (target API level policy). This PR targets API 37 (Android 17, the latest stable release) instead of the minimum 36, so the app also clears the next annual deadline without another bump.
What changed
The actual requirement (app module only):
app_target_sdk/app_compile_sdk: 35 → 37;app_version_code3 → 4, versionName 1.0.1SDK library — public contract unchanged: compileSdk/targetSdk 35, minSdk 16, version 0.5.14. The Play policy applies only to the uploaded app binary, and the SDK keeps its documented Android 4.1+ support, so no SDK release is part of this PR.
Toolchain cascade forced by compileSdk 37 (per the AGP compatibility table it needs AGP ≥ 9.1.1):
compileSdkVersion/minSdkVersion/targetSdkVersion;=assignments replace the space syntax Gradle 10 removes; librarytargetSdkmoved totestOptions(AGP 9 requirement)buildFeatures { buildConfig = true }insdkreplaces the removedandroid.defaults.buildfeatures.buildconfigflag; droppedandroid.enableJetifier(all deps are AndroidX)cimg/android:2026.07.1(JDK 21, SDK 37 preinstalled); removed-in-AGP-9androidDependenciestask replaced with:sdk:dependencies :app:dependenciesproguard-android-optimize.txtreplacesproguard-android.txtin both modules — AGP 9 rejects the old default file (inert whileminifyEnabled = false)--add-openstest JVM args — the old stack cannot run on JDK 17+ (broken since CI dropped the Java 8 pin); full:sdk:testpasses on JDK 21 with this toolchainjitpack.ymlpinning JDK 17 — JitPack's default JDK 8 can't run Gradle 9, which would have broken the next tagged release buildDraft until
:sdk:testverified locally on JDK 21 / Gradle 9.5 / AGP 9.3 / SDK 37)