Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f6996bb
build: Raise minimum AGP to 9.1.1 for Android 17 toolchain prep
0xadam-brown Jul 2, 2026
789bbaa
build(android): Bump compileSdk and targetSdk to API 37 (Android 17)
0xadam-brown Jul 2, 2026
44934c7
fix(ci): Unblock Build workflow snapshot upload and Danger changelog
0xadam-brown Jul 2, 2026
b969885
fix(ci): Harden snapshot upload after Gradle cache hits
0xadam-brown Jul 2, 2026
cf0c9c4
fix(ci): Skip snapshot upload when Gradle cache omits test output
0xadam-brown Jul 2, 2026
cc72ae4
build: Drop CI, tooling, and distribution changes from API bump
runningcode Jul 16, 2026
4efbdd1
build(android): Pin Kotlin JVM toolchain to 8 across modules
runningcode Jul 16, 2026
375488c
Format code
getsentry-bot Jul 16, 2026
5ae12d4
build(android): Pin Kotlin JVM toolchain to 8 for fragment and timber
runningcode Jul 16, 2026
58caca0
build(android): Pin Kotlin JVM toolchain to 8 for compose
runningcode Jul 16, 2026
7591fb7
build(android): Bump uitest module Kotlin jvmTarget to 11
runningcode Jul 16, 2026
34c5da5
build(android): Drop JDK 8 toolchain pin from apache http client
runningcode Jul 16, 2026
36ad602
build(android): Set testBuildType to release for AGP 9 unit tests
runningcode Jul 16, 2026
cd75726
build(android): Add Google Maven to plugin repositories
runningcode Jul 16, 2026
e338caa
build(android): Pin Kotlin JVM toolchain to 8 for core
runningcode Jul 16, 2026
b1e50fc
build(android): Pin Java and Kotlin targets to 8 for Android modules
runningcode Jul 16, 2026
c6b4dfb
build(android): Centralize Java 8 compileOptions for library modules
runningcode Jul 16, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/agp-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
agp: [ '8.7.0','8.8.0','8.9.0' ]
agp: [ '9.1.1', '9.2.0', '9.2.1' ]
integrations: [ true, false ]

name: AGP Matrix Release - AGP ${{ matrix.agp }} - Integrations ${{ matrix.integrations }}
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Features

- Session Replay: Record segment names (transaction names) ([#5763](https://github.com/getsentry/sentry-java/pull/5763))

- Officially supports Android 17. Updated targetSdk and compileSdk to API 37 ([#5675](https://github.com/getsentry/sentry-java/pull/5675))
- Add `io.sentry:sentry-opentelemetry-bom` to align Sentry OpenTelemetry modules with tested OpenTelemetry dependencies ([#5629](https://github.com/getsentry/sentry-java/pull/5629))
- Spring Boot Gradle plugin: add the Sentry BOM to `dependencyManagement`; explicit imports are applied after Spring Boot's implicit BOM
```kotlin
Expand Down
12 changes: 12 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ subprojects {
}
}

// AGP 9 defaults Android modules to Java 11. Pin the published library modules back
// to Java 8 so their bytecode stays consumable by Java 8 projects, mirroring the
// java-library pin above.
plugins.withId("com.android.library") {
configure<com.android.build.gradle.BaseExtension> {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
}

apply<MavenPublishPlugin>()

afterEvaluate {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

object Config {
val AGP = System.getenv("VERSION_AGP") ?: "8.13.1"
val AGP = System.getenv("VERSION_AGP") ?: "9.2.1"
val kotlinStdLib = "stdlib-jdk8"
val kotlinStdLibVersionAndroid = "1.9.24"
val kotlinTestJunit = "test-junit"
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled

# AndroidX required by AGP >= 3.6.x
android.useAndroidX=true
android.experimental.lint.version=8.13.1
# AGP 9+ migration opt-outs until we remove kotlin-android plugin and adopt built-in Kotlin.
android.builtInKotlin=false
android.newDsl=false
android.experimental.lint.version=9.2.1

# Release information
versionName=8.48.0
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ springboot4 = "4.1.0"
sqldelight = "2.3.2"

# Android
targetSdk = "36"
compileSdk = "36"
targetSdk = "37"
compileSdk = "37"
minSdk = "21"

[plugins]
Expand Down
7 changes: 6 additions & 1 deletion sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import net.ltgt.gradle.errorprone.errorprone
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8

plugins {
id("com.android.library")
Expand Down Expand Up @@ -33,7 +34,11 @@ android {
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
}

kotlin { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 }
// AGP 9 only generates unit tests for the testBuildType. CI disables the debug
// variant, so unit tests must target release to run at all.
testBuildType = "release"

kotlin { compilerOptions.jvmTarget = JVM_1_8 }

testOptions {
animationsDisabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public SentryFrameMetricsCollector(
}

@SuppressWarnings("deprecation")
@SuppressLint({"NewApi", "PrivateApi"})
@SuppressLint({"NewApi", "PrivateApi", "DiscouragedPrivateApi"})
public SentryFrameMetricsCollector(
final @NotNull Context context,
final @NotNull ILogger logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
android:layout_height="wrap_content"
android:hint="Your Name"
android:inputType="textPersonName"
android:autofillHints="name"
android:background="@drawable/sentry_edit_text_border"
android:paddingHorizontal="8dp"
android:layout_below="@id/sentry_dialog_user_feedback_txt_name" />
Expand All @@ -66,6 +67,7 @@
android:layout_height="wrap_content"
android:hint="your.email@example.org"
android:inputType="textEmailAddress"
android:autofillHints="emailAddress"
android:background="@drawable/sentry_edit_text_border"
android:paddingHorizontal="8dp"
android:layout_below="@id/sentry_dialog_user_feedback_txt_email" />
Expand All @@ -85,6 +87,7 @@
android:layout_height="wrap_content"
android:lines="6"
android:inputType="textMultiLine"
android:importantForAutofill="no"
android:gravity="top|left"
android:hint="What's the bug? What did you expect?"
android:background="@drawable/sentry_edit_text_border"
Expand Down
7 changes: 6 additions & 1 deletion sentry-android-distribution/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
Expand All @@ -12,6 +13,10 @@ android {
defaultConfig { minSdk = libs.versions.minSdk.get().toInt() }
buildFeatures { buildConfig = false }

// AGP 9 only generates unit tests for the testBuildType. CI disables the debug
// variant, so unit tests must target release to run at all.
testBuildType = "release"

testOptions {
unitTests.apply {
isReturnDefaultValues = true
Expand All @@ -21,7 +26,7 @@ android {
}

kotlin {
jvmToolchain(17)
compilerOptions.jvmTarget = JVM_1_8
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
explicitApi()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.annotation.Config

@RunWith(AndroidJUnit4::class)
@Config(sdk = [35])
class UpdateResponseParserTest {

private lateinit var options: SentryOptions
Expand Down
12 changes: 9 additions & 3 deletions sentry-android-fragment/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("com.android.library")
Expand All @@ -23,10 +25,14 @@ android {
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
}

// AGP 9 only generates unit tests for the testBuildType. CI disables the debug
// variant, so unit tests must target release to run at all.
testBuildType = "release"

kotlin {
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import net.ltgt.gradle.errorprone.errorprone
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
Expand Down Expand Up @@ -64,13 +65,11 @@ android {
}
}

kotlin { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 }
kotlin { compilerOptions.jvmTarget = JvmTarget.JVM_11 }

lint {
warningsAsErrors = true
checkDependencies = true
// Suppress OldTargetApi: lint 8.13.1 expects API 37 but we target 36
disable += "OldTargetApi"

// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks.
checkReleaseBuilds = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
Expand Down Expand Up @@ -31,7 +32,7 @@ android {
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
kotlin { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 }
kotlin { compilerOptions.jvmTarget = JvmTarget.JVM_11 }
buildFeatures { compose = true }
composeOptions { kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() }
androidComponents.beforeVariants {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11

plugins {
id("com.android.test")
alias(libs.plugins.kotlin.android)
Expand Down Expand Up @@ -30,7 +32,7 @@ android {
targetCompatibility = JavaVersion.VERSION_11
}

kotlin { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 }
kotlin { compilerOptions.jvmTarget = JVM_11 }

targetProjectPath = ":sentry-samples:sentry-samples-android"
// Run the test in its own process so it measures the target app cold, not itself.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import net.ltgt.gradle.errorprone.errorprone
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
Expand Down Expand Up @@ -56,19 +57,18 @@ android {
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("debug") // to be able to run release mode
testProguardFiles("proguard-rules.pro")
}
}

kotlin { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 }
kotlin { compilerOptions.jvmTarget = JvmTarget.JVM_11 }

lint {
warningsAsErrors = true
checkDependencies = true
// Suppress OldTargetApi: lint 8.13.1 expects API 37 but we target 36
disable += "OldTargetApi"

// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks.
checkReleaseBuilds = false
Expand Down
12 changes: 9 additions & 3 deletions sentry-android-navigation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("com.android.library")
Expand All @@ -23,10 +25,14 @@ android {
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
}

// AGP 9 only generates unit tests for the testBuildType. CI disables the debug
// variant, so unit tests must target release to run at all.
testBuildType = "release"

kotlin {
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.jvmTarget = JVM_1_8
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
}

testOptions {
Expand Down
4 changes: 4 additions & 0 deletions sentry-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ android {
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
}

// AGP 9 only generates unit tests for the testBuildType. CI disables the debug
// variant, so unit tests must target release to run at all.
testBuildType = "release"

kotlin { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 }

testOptions {
Expand Down
17 changes: 10 additions & 7 deletions sentry-android-replay/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

plugins {
Expand All @@ -25,20 +27,21 @@ android {

buildFeatures { compose = true }

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
useLiveLiterals = false
}
composeOptions { kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() }

buildTypes {
getByName("debug") { consumerProguardFiles("proguard-rules.pro") }
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
}

// AGP 9 only generates unit tests for the testBuildType. CI disables the debug
// variant, so unit tests must target release to run at all.
testBuildType = "release"

kotlin {
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ internal class SimpleVideoEncoder(
val videoCapabilities =
mediaCodec.codecInfo.getCapabilitiesForType(muxerConfig.mimeType).videoCapabilities

if (!videoCapabilities.bitrateRange.contains(bitRate)) {
if (videoCapabilities != null && !videoCapabilities.bitrateRange.contains(bitRate)) {
options.logger.log(
DEBUG,
"Encoder doesn't support the provided bitRate: $bitRate, the value will be clamped to the closest one",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import kotlin.test.Test
import kotlin.test.assertTrue
import org.junit.runner.RunWith
import org.mockito.kotlin.mock
import org.robolectric.annotation.Config

@RunWith(AndroidJUnit4::class)
@Config(sdk = [35])
class ScreenshotRecorderTest {

internal class Fixture() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import kotlin.test.assertTrue
import org.junit.runner.RunWith
import org.robolectric.Robolectric.buildActivity
import org.robolectric.Shadows.shadowOf
import org.robolectric.annotation.Config

@RunWith(AndroidJUnit4::class)
@Config(sdk = [35])
class ViewsTest {

@BeforeTest
Expand Down
12 changes: 9 additions & 3 deletions sentry-android-sqlite/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("com.android.library")
Expand All @@ -23,10 +25,14 @@ android {
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
}

// AGP 9 only generates unit tests for the testBuildType. CI disables the debug
// variant, so unit tests must target release to run at all.
testBuildType = "release"

kotlin {
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
}

testOptions {
Expand Down
Loading
Loading