Skip to content

Conversation

tonidero
Copy link
Contributor

@tonidero tonidero commented Jul 8, 2025

Description

This updates Kotlin in our project to 2.0.21 while keeping the language level and api level in our libraries to 1.8, to avoid causing breaking changes

@@ -31,7 +31,7 @@ fragment = "1.6.1"
hamcrest = "1.3"
recyclerview = "1.2.1"
roboelectric = "4.11.1"
kotlin = "1.8.22"
kotlin = "2.0.21"
# Can't update until we use more recent kotlin. 1.6.0 uses Kotlin 1.9.0
kotlinxSerializationJSON = "1.5.1"
Copy link
Contributor

@vegaro vegaro Jul 8, 2025

Choose a reason for hiding this comment

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

we'll be finally able to update this 💃

Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.32%. Comparing base (7414e17) to head (8e6c6ee).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...c/main/kotlin/com/revenuecat/purchases/Offering.kt 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2493      +/-   ##
==========================================
- Coverage   78.33%   78.32%   -0.01%     
==========================================
  Files         286      286              
  Lines       10432    10507      +75     
  Branches     1500     1485      -15     
==========================================
+ Hits         8172     8230      +58     
- Misses       1614     1631      +17     
  Partials      646      646              

☔ 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 added the pr:breaking Changes that are breaking label Jul 8, 2025
@tonidero tonidero marked this pull request as ready for review July 9, 2025 08:56
@tonidero tonidero requested review from JayShortway, vegaro and a team July 9, 2025 08:56
Copy link
Member

@JayShortway JayShortway left a comment

Choose a reason for hiding this comment

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

Let's go! 🚀 Minor things only.

@@ -66,7 +66,7 @@ package com.revenuecat.purchases.ui.revenuecatui {
method public default void onRestoreStarted();
}

public final class PaywallOptions {
@androidx.compose.runtime.Immutable public final class PaywallOptions {
Copy link
Member

Choose a reason for hiding this comment

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

I got these too. How's that possible? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was indeed confused about this... I would have expected it to be annotated from before this PR, so no idea why it was added with this PR...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we're not failing tests on changes on the UI library, only on the main SDK?

Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking along those lines, but still not sure what's going on. I've tried this on main:

./gradlew :ui:revenuecatui:metalavaCheckCompatibilityDefaultsRelease

☝️ checking doesn't fail

👇 generating shows new changes

./gradlew :ui:revenuecatui:metalavaGenerateSignatureDefaultsRelease

Copy link
Member

Choose a reason for hiding this comment

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

and then checking again (with the newly generated API dump), doesn't fail either..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just tried removing an entire class from the api.txt file and it doesn't fail either... So it doesn't seem to be working for some reason :/

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, that's truly interesting 🤔 Maybe its checking function doesn't detect annotations?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should not use the checking task, and just generate new API dump files and using git to verify there's no diff? (All of this goes beyond the scope of this PR of course.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I don't think it's due to the automations, since it doesn't seem to fail either after I modify the api file and remove an entire class... And yeah, generating new API files and checking git should also work, though a bit more cumbersome 😅

@tonidero tonidero enabled auto-merge July 10, 2025 11:15
Copy link
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

Very nice! 🚀

@tonidero tonidero added this pull request to the merge queue Jul 10, 2025
Merged via the queue into main with commit 298c8b5 Jul 10, 2025
12 checks passed
@tonidero tonidero deleted the update-kotlin-2.0.21 branch July 10, 2025 12:24
github-merge-queue bot pushed a commit that referenced this pull request Jul 10, 2025
### Description
This updates the CustomEntitlementComputation sample app to kotlin
1.8.22. This is needed after dropping support for 1.7 in #2493
@tonidero tonidero mentioned this pull request Jul 10, 2025
tonidero added a commit that referenced this pull request Jul 10, 2025
## RevenueCat SDK
This release updates the SDK to use Google Play Billing Library 8. This
version of the Billing Library removed APIs to query for expired
subscriptions and consumed one-time products, aside from other
improvements. You can check the full list of changes here:
https://developer.android.com/google/play/billing/release-notes#8-0-0

Additionally, we've also updated Kotlin to 2.0.21 and our new minimum
version is Kotlin 1.8.0+. If you were using an older version of Kotlin,
you will need to update it.

Regarding API changes, we've also removed data classes from our public
APIs. This means that for classes that were previously data classes, the
`copy` function and `componentN` functions (destructuring declarations)
have been removed. `equals` and `hashCode` functions still work as
before.

### Play Billing Library 8: No expired subscriptions or consumed
one-time products

**Note:** the following is only relevant if you recently integrated
RevenueCat, and do not (yet) have all your transactions imported.
  
Play Billing Library 8 removed functionality to query expired
subscriptions or consumed one-time products. This means that, for users
migrating from a non-RevenueCat implementation of the Play Billing
Library, the SDK will not be able to send purchase information from
these purchases. We can still ingest historical data from these
purchases through a backend historical import. See
[docs](https://www.revenuecat.com/docs/migrating-to-revenuecat/migrating-existing-subscriptions).
This doesn't affect developers that have all transactions in RevenueCat,
which is true for the vast majority.

### Bumped minimum Kotlin version

RevenueCat SDK v9 bumps Kotlin to 2.0.21, with a minimum Kotlin version
of 1.8.0.

### Using the SDK with your own IAP code (previously Observer Mode)

Using the SDK with your own IAP code is still supported in v9. Other
than updating the SDK version, there are no changes required. Just make
sure the version of the Play Billing Library is also version 8.0.0+.

### 💥 Breaking Changes
* Removes data classes from public API (#2498) via JayShortway
(@JayShortway)
* Marks `PaywallData` and `PaywallColor` as `InternalRevenueCatAPI`.
(#2507) via JayShortway (@JayShortway)
* BC8 migration (#2506) via Toni Rico (@tonidero)
* Update to kotlin 2.0.21 while keeping language compatibility (#2493)
via Toni Rico (@tonidero)

### 🔄 Other Changes
* Update CustomEntitlementComputation sample app kotlin version (#2510)
via Toni Rico (@tonidero)
* Fix `Switch` component previews (#2509) via Toni Rico (@tonidero)
* Add V9 migration guide (#2508) via Toni Rico (@tonidero)
* [AUTOMATIC][Paywalls V2] Updates paywall-preview-resources submodule
(#2499) via RevenueCat Git Bot (@RCGitBot)

---------

Co-authored-by: JayShortway <29483617+JayShortway@users.noreply.github.com>
tonidero added a commit to RevenueCat/purchases-hybrid-common that referenced this pull request Jul 17, 2025
PHC version of RevenueCat/purchases-android#2493

This updates Kotlin to 2.0.21 while keeping compatibility with versions
up to 1.8.
tonidero added a commit that referenced this pull request Aug 25, 2025
This updates the CustomEntitlementComputation sample app to kotlin
1.8.22. This is needed after dropping support for 1.7 in #2493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:breaking Changes that are breaking pr:other
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants