Skip to content
Draft
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
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
4 changes: 2 additions & 2 deletions .sauce/sentry-uitest-android-benchmark-lite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ espresso:

suites:

- name: "Android 15 Benchmark lite (api 35)"
- name: "Android 17 Benchmark lite (api 37)"
testOptions:
clearPackageData: true
useTestOrchestrator: true
devices:
- name: ".*"
platformVersion: "15"
platformVersion: "17"

artifacts:
download:
Expand Down
4 changes: 2 additions & 2 deletions .sauce/sentry-uitest-android-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ espresso:
testApp: ./sentry-android-integration-tests/sentry-uitest-android/build/outputs/apk/androidTest/release/sentry-uitest-android-release-androidTest.apk
suites:

- name: "Android 15 Ui test (api 35)"
- name: "Android 17 Ui test (api 37)"
testOptions:
clearPackageData: true
useTestOrchestrator: true
devices:
- name: ".*"
platformVersion: "15"
platformVersion: "17"

# Controls what artifacts to fetch when the suite on Sauce Cloud has finished.
artifacts:
Expand Down
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ The project uses **Gradle** with Kotlin DSL. Key build files:
- `buildSrc/` and `build-logic/` - Custom build logic and plugins
- `Makefile` - High-level build commands

### Android toolchain (compileSdk 37 / Android 17)
- **Minimum Android Studio:** Panda 3 | 2025.3.3 Patch 1 or newer ([platform requirements](https://developer.android.com/build/releases/about-agp))
- **Minimum AGP:** 9.1.1 (fallback in `buildSrc/src/main/java/Config.kt`, currently 9.2.1)
- **Minimum Gradle:** 9.4.1 (wrapper in `gradle/wrapper/gradle-wrapper.properties`)
- SDK levels live in `gradle/libs.versions.toml` (`compileSdk`, `targetSdk`, `minSdk`)
- **AGP 9 migration:** `gradle.properties` sets `android.builtInKotlin=false` and `android.newDsl=false` until we remove `kotlin-android` and adopt built-in Kotlin / new DSL (required before AGP 10)

## Essential Commands

### Development Workflow
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- Officially supports Android 17. Updated targetSdk and compileSdk to API 37

### Behavioral Changes

- `SentryOkHttpInterceptor::intercept` now throws `IOException`. This is a source-only and Java-only breaking change ([#5654](https://github.com/getsentry/sentry-java/pull/5654))
Expand Down
19 changes: 19 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.android.build.gradle.AppExtension
import com.android.build.gradle.LibraryExtension
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
Expand Down Expand Up @@ -117,6 +119,23 @@ allprojects {
subprojects {
apply { plugin("io.sentry.spotless") }

pluginManager.withPlugin("com.android.library") {
extensions.configure<LibraryExtension> {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
}
pluginManager.withPlugin("com.android.application") {
extensions.configure<AppExtension> {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
}

plugins.withId(Config.QualityPlugins.detektPlugin) {
configure<DetektExtension> {
buildUponDefaultConfig = true
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.46.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 @@ -45,8 +45,8 @@ springboot4 = "4.0.0"
sqldelight = "2.3.2"

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

[plugins]
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
5 changes: 5 additions & 0 deletions sentry-android-distribution/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ android {
defaultConfig { minSdk = libs.versions.minSdk.get().toInt() }
buildFeatures { buildConfig = false }

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

testOptions {
unitTests.apply {
isReturnDefaultValues = true
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
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ android {
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
Expand Up @@ -56,6 +56,7 @@ 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")
Expand All @@ -67,8 +68,6 @@ android {
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
5 changes: 1 addition & 4 deletions sentry-android-replay/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ 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") }
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
2 changes: 0 additions & 2 deletions sentry-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ android {
buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
}

sourceSets["main"].apply { manifest.srcFile("src/androidMain/AndroidManifest.xml") }

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