Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ parameters:
default: alpha

commands:
android-dependencies:
Comment thread
AlvaroBrey marked this conversation as resolved.
steps:
- android/restore_gradle_cache
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- android/save_gradle_cache

prepare-signing-key:
steps:
- run:
Expand Down Expand Up @@ -147,7 +139,7 @@ jobs:
- revenuecat/install-gem-unix-dependencies:
cache-version: v1
- android/accept_licenses
- android-dependencies
- android/restore_gradle_cache
- android/restore_build_cache
- run:
name: Build sample app
Expand All @@ -164,7 +156,7 @@ jobs:
- revenuecat/install-gem-unix-dependencies:
cache-version: v1
- android/accept_licenses
- android-dependencies
- android/restore_gradle_cache
- android/restore_build_cache
- run:
name: Build sample app
Expand All @@ -181,7 +173,7 @@ jobs:
- revenuecat/install-gem-unix-dependencies:
cache-version: v1
- android/accept_licenses
- android-dependencies
- android/restore_gradle_cache
- android/restore_build_cache
- run:
name: Build sample app
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Or view / build our Android sample app:

## Requirements
- Java 8+
- Kotlin 1.8.0+
- Kotlin 2.1.0+
- Minimum target: Android 6.0+ (API level 23+)
- Paywalls and Customer Center minimum target: Android 7.0+ (API level 24+)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.revenuecat.purchases.android.buildlogic.convention

import com.android.build.api.variant.HasUnitTestBuilder
import com.android.build.api.variant.LibraryAndroidComponentsExtension
import com.android.build.gradle.LibraryExtension
import com.revenuecat.purchases.android.buildlogic.ktx.getVersion
import com.revenuecat.purchases.android.buildlogic.ktx.versionCatalog
Expand All @@ -24,6 +26,12 @@ internal fun Project.configureAndroidLibrary() {
return result
}

extensions.configure<LibraryAndroidComponentsExtension> {
beforeVariants { variantBuilder ->
(variantBuilder as HasUnitTestBuilder).enableUnitTest = true
}
}

extensions.configure<LibraryExtension> {
compileSdk = compileSdkVersion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
}

val localProperties = Properties()
Expand Down Expand Up @@ -54,9 +55,6 @@ android {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.8"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
plugins {
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.kotlin.android).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[versions]
agp = "8.13.2"
kotlin = "1.8.22"
kotlin = "2.2.21"
purchases = "10.20.0-SNAPSHOT"
androidxCore = "1.10.1"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

[libraries]
androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidxCore" }
Expand Down
2 changes: 1 addition & 1 deletion examples/MagicWeather/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
agp = "8.13.2"
androidxNavigation = "2.6.0"
kotlin = "1.9.0"
kotlin = "2.2.21"
purchases = "10.20.0-SNAPSHOT"
lifecycle = "2.6.1"
androidxCore = "1.10.1"
Expand Down
4 changes: 1 addition & 3 deletions examples/MagicWeatherCompose/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
}

android {
Expand Down Expand Up @@ -49,9 +50,6 @@ android {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.8"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand Down
1 change: 1 addition & 0 deletions examples/MagicWeatherCompose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
plugins {
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.kotlin.android).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
}
3 changes: 2 additions & 1 deletion examples/MagicWeatherCompose/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[versions]
agp = "8.13.2"
androidxNavigation = "2.5.3"
kotlin = "1.8.22"
kotlin = "2.2.21"
purchases = "10.20.0-SNAPSHOT"
lifecycle = "2.5.0"
androidxCore = "1.10.1"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

[libraries]
androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidxCore" }
Expand Down
9 changes: 6 additions & 3 deletions examples/checkpointtester/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,17 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
}
}

kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}

dependencies {
implementation(project(":purchases"))
implementation(project(":ui:revenuecatui"))
Expand Down
9 changes: 6 additions & 3 deletions examples/rcttester/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
}
}

kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}

dependencies {
// RevenueCat SDK
implementation(project(":purchases"))
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ org.gradle.jvmargs=-Xmx4096M -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8

# Enable the Gradle build cache (local task-output cache) for the main build.
org.gradle.caching=true

# backwards compatibility flags for AGP9, to be enabled in a future PR
android.builtInKotlin=false
android.newDsl=false
Comment thread
AlvaroBrey marked this conversation as resolved.
12 changes: 5 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android-compileSdk = "36"
android-minSdk = "23"
android-targetSdk = "36"

agp = "8.13.2"
agp = "9.2.1"
activityCompose = "1.9.3"
Comment thread
AlvaroBrey marked this conversation as resolved.
# Note that version 18.0.1 adds the AD_ID permission to the SDK.
# We should not add that permission ourselves, so keeping it at 17.0.1 for now.
Expand Down Expand Up @@ -42,9 +42,8 @@ googleBlockstore = "16.4.0"
hamcrest = "1.3"
recyclerview = "1.2.1"
roboelectric = "4.16"
kotlin = "2.0.21"
kotlin = "2.2.21"
kotlinLanguage = "1.8"
# Can't update until we use more recent kotlin. 1.6.0 uses Kotlin 1.9.0
kotlinxSerializationJSON = "1.5.1"
samsungIap = "6.5.2"
kover = "0.9.9"
Expand All @@ -56,9 +55,8 @@ metalava = "0.5.0"
mockk = "1.13.11"
mockwebserver = "4.2.0"
multidex = "2.0.1"
# Can't use alpha04 because it requires higher Kotlin version than we're using
paparrazzi = "2.0.0-alpha02"
poko = "0.17.2"
paparrazzi = "2.0.0-alpha05"
poko = "0.20.2"
testJUnit = "1.2.1"
testJUnitParams = "1.1.1"
testLibraries = "1.6.1"
Expand All @@ -69,7 +67,7 @@ webkit = "1.16.0"
junit = "1.2.1"
uiautomator = "2.3.0"
benchmarkMacroJunit4 = "1.3.4"
baselineprofile = "1.4.1"
baselineprofile = "1.5.0-rc02"
profileinstaller = "1.4.1"
leakcanary = "2.14"
kotlinpoet = "1.18.1"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
21 changes: 21 additions & 0 deletions migrations/v11-MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# V11 API Migration Guide

This release updates the SDK's build toolchain to Android Gradle Plugin 9 and Kotlin 2.2.21. Our new minimum version is Kotlin 2.1.0+.


### New minimum Kotlin version

RevenueCat SDK v11 bumps minimum Kotlin version to 2.1.0, up from 1.8.0 in v10.

A Kotlin compiler can only read metadata from at most one minor version ahead of itself, so a compiler older than 2.1 cannot read the 2.2.x standard library and the build fails with:

```
Module was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 2.2.0, expected version is 2.0.0.
```

If you see this, update the Kotlin Gradle Plugin in your app to 2.1.0 or newer.

### Reporting undocumented issues:

Feel free to file an issue! [New RevenueCat Issue](https://github.com/RevenueCat/purchases-android/issues/new/).
9 changes: 6 additions & 3 deletions test-apps/e2etests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,18 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
buildConfig = true
}
}

kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}

dependencies {
implementation(project(":purchases"))
implementation(project(":ui:debugview"))
Expand Down
2 changes: 1 addition & 1 deletion test-apps/sdksizetesting/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
agp = "8.13.2"
kotlin = "2.0.21"
kotlin = "2.2.21"
coreKtx = "1.17.0"
junit = "4.13.2"
junitVersion = "1.3.0"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.