Skip to content

Increase targetSdkVersion to 36#2446

Merged
tonidero merged 29 commits into
mainfrom
increase-target-sdk-version-36
Apr 7, 2026
Merged

Increase targetSdkVersion to 36#2446
tonidero merged 29 commits into
mainfrom
increase-target-sdk-version-36

Conversation

@tonidero

@tonidero tonidero commented Jun 16, 2025

Copy link
Copy Markdown
Contributor

Description

This increases the target and compile Sdk versions of our SDKs and apps to android 16 (36). https://developer.android.com/about/versions/16/behavior-changes-16


Note

Medium Risk
Raising compileSdk/targetSdk and updating robolectric/paparazzi can surface behavior changes and test/runtime regressions; most code changes are build/test scaffolding rather than core SDK logic.

Overview
Updates the project and example apps to compile/target Android SDK 36, centralizing SDK version numbers in gradle/libs.versions.toml and removing the old top-level buildscript extra version fields.

Refreshes test/tooling dependencies (notably robolectric, espresso, paparazzi, and AndroidX test libs) and applies required follow-ups: new Proguard -dontwarn rules for integration tests, adds robolectric.properties to pin sdk for Paparazzi, and hardens a Compose UI test by waiting for the error snackbar to clear before retrying.

Includes small Compose sample adjustments for newer Material3 APIs (e.g., TopAppBar usage) and removes status-bar side effects from example themes; backend integration test golden request headers are updated to reflect platform version 36.

Written by Cursor Bugbot for commit 4ac3db3. This will update automatically on new commits. Configure here.

@emerge-tools

emerge-tools Bot commented Jun 16, 2025

Copy link
Copy Markdown

📸 Snapshot Test

181 modified, 7 added, 7 removed, 394 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility Paparazzi
com.revenuecat.testpurchasesuiandroidcompatibility.paparazzi
7 7 181 0 69 0 ⏳ Needs approval
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
0 0 0 0 325 0 N/A

🛸 Powered by Emerge Tools

@tonidero

This comment was marked as outdated.

@tonidero tonidero force-pushed the increase-target-sdk-version-36 branch from d6c509c to 21b2790 Compare December 2, 2025 12:06
Comment thread build.gradle.kts
Comment thread ui/revenuecatui/build.gradle.kts Outdated
// This is needed because of an incompatibility between Robolectric and Paparazzi:
// https://github.com/cashapp/paparazzi/issues/1979
forkEvery = 1
maxParallelForks = 5

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Honestly I'm not in love with this and it does cause tests to be noticeable slower... but the alternative is to split the Paparazzi tests (right now we have 2 classes) into a separate module, and we're using internal APIs, so that isn't straightforward.

Comment thread gradle/libs.versions.toml
@tonidero tonidero marked this pull request as ready for review December 2, 2025 12:22
@tonidero tonidero requested a review from a team as a code owner December 2, 2025 12:22
@tonidero tonidero requested a review from a team December 2, 2025 12:22

@ajpallares ajpallares left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it makes sense, but some things escape my expertise... will leave approval to someone with more knowledge 🙏

@codecov

codecov Bot commented Dec 3, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.47%. Comparing base (a485da9) to head (4ac3db3).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2446   +/-   ##
=======================================
  Coverage   79.47%   79.47%           
=======================================
  Files         357      357           
  Lines       14351    14351           
  Branches     1960     1960           
=======================================
  Hits        11406    11406           
  Misses       2141     2141           
  Partials      804      804           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tonidero tonidero requested a review from a team as a code owner December 11, 2025 16:08
@tonidero tonidero force-pushed the increase-target-sdk-version-36 branch from a87263b to df6fa9d Compare December 11, 2025 16:14
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was using a deprecated API in Android 36. Since it's only used for previews, and it shouldn't really matter, I just removed it.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

},
backgroundColor = Color.Transparent,
elevation = 0.dp,
modifier = Modifier.background(Color.Transparent),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Transparent background not applied to Material3 TopAppBar

Low Severity

Modifier.background(Color.Transparent) does not replicate the old Material TopAppBar's backgroundColor = Color.Transparent behavior. Material3's TopAppBar renders its own container color (defaulting to the theme surface color) on top of the modifier background, so the bar won't actually be transparent. The colors parameter with TopAppBarDefaults.topAppBarColors(containerColor = Color.Transparent) is the correct way to achieve this in Material3.

Fix in Cursor Fix in Web

@@ -0,0 +1 @@
sdk=34

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is another workaround someone mentioned. Basically run robolectric tests in a lower target to avoid the conflicts with Paparazzi. Seems to work fine and probably better than the previous workaround (run each test class in a different JVM which made it super slow)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@JayShortway in case you have any thoughts on the new approach for making this work. Planning to merge this next week as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is fine, indeed much better than creating a new JVM for each. Might be good to add a comment in the file explaining why we have that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Did in 4ac3db3 :)

).performClick()

// Wait for error snackbar to appear and disappear so it doesn't overlay the button
composeTestRule.waitUntilDoesNotExist(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had to add this to make the test pass. I believe with the library updates, the snackbar was interfering with the second touch. Until the snackbar went away, we couldn't tap again. I didn't want to modify the behavior of the feature, so I added this to the test. Lmk what you think 🙏

@tonidero

tonidero commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

I gave it another shoot with another workaround for the issues we were seeing, and seems to be working. Seems the snapshots changes are mostly due to shadows, likely they were modified with the android runtime. Would appreciate another look! 🙇 @RevenueCat/coresdk @vegaro

@tonidero tonidero requested review from a team, ajpallares and vegaro April 1, 2026 07:28

@vegaro vegaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Almost there! Thanks for persevering

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just noting that looks like the regular MagicWeather is still in compileSdk = 34

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed... We do need to fix the UI a bit there to support edge to edge (which is mandatory when targeting 36). Maybe we can leave it for later? Good to bring it up though!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sure no problem! just making sure you knew and you hadn't missed it there

#-renamesourcefileattribute SourceFile
-keep class com.revenuecat.purchases.** { *; }
-dontwarn javax.lang.model.element.Modifier
-dontwarn com.google.errorprone.annotations.IncompatibleModifiers

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I asume these are needed because of RoboElectric

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed. I only run into issues with this for this integration tests module, which was weird for me... I didn't run into issues when running instrumentation tests in release mode in the purchases module, so I added these here. But without the robolectric bump, these are not needed, so I don't think it would affect customers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry I actually meant espresso. With the bump of espresso, this became necessary.

Comment thread gradle/libs.versions.toml
@tonidero tonidero requested a review from vegaro April 1, 2026 11:01
@tonidero tonidero added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit 9785aff Apr 7, 2026
39 of 40 checks passed
@tonidero tonidero deleted the increase-target-sdk-version-36 branch April 7, 2026 17:05
@tonidero tonidero mentioned this pull request Apr 7, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Apr 8, 2026
## RevenueCat SDK
> [!WARNING]  
> If you don't have any login system in your app, please make sure your
one-time purchase products have been correctly configured in the
RevenueCat dashboard as either consumable or non-consumable. If they're
incorr as consumables, RevenueCat will consume these purchases. This
means that users won't be able to restore them from version 10.0.0
onward.
> Non-consumables are products that are meant to be bought only once,
for example, lifetime subscriptions. Please see more information in our
[docs](https://www.revenuecat.com/docs/known-store-issues/play-billing-library/restore-consumable-purchases-bc8)

### 💥 Breaking Changes
This release updates to Billing Library 8.3.0 with min SDK supported of
Android 6 (API 23), previously min was 21. It also removes a previous
workaround used to be able to restore consumed one time products which
is not available anymore.

* Update to Billing Library 8.3.0 (#3256) via Toni Rico (@tonidero)
* Revert AIDL workaround for consumed consumables (#3255) via Toni Rico
(@tonidero)

### 🔄 Other Changes
* Bump fastlane-plugin-revenuecat_internal from `6289be1` to `ceecf91`
(#3301) via dependabot[bot] (@dependabot[bot])
* Increase targetSdkVersion to 36 (#2446) via Toni Rico (@tonidero)
* [AUTOMATIC] Update golden test files for backend integration tests
(#3302) via RevenueCat Git Bot (@RCGitBot)
* Bump fastlane-plugin-revenuecat_internal from `5d6e93f` to `6289be1`
(#3299) via dependabot[bot] (@dependabot[bot])
* Bump fastlane-plugin-revenuecat_internal from `f11fe40` to `5d6e93f`
(#3294) via dependabot[bot] (@dependabot[bot])


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Primarily a release/version bump, but it ships documented breaking
changes (minSdk 23 via Billing Library 8.3.0 and removal of a restore
workaround) that can affect app compatibility and restore behavior.
> 
> **Overview**
> Bumps the project from `9.30.0-SNAPSHOT` to `10.0.0` across build
metadata (`.version`, `gradle.properties`, `Config.frameworkVersion`)
and sample/test app dependency pins.
> 
> Updates release documentation: adds `10.0.0` entries to
`CHANGELOG.md`/`CHANGELOG.latest.md` (including a warning and
breaking-change notes) and introduces `migrations/v10-MIGRATION.md`.
> 
> Adjusts docs publishing to serve `10.0.0` by updating
`docs/index.html` redirect and the CircleCI S3 sync path in
`docs-deploy`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d18f479. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants