Skip to content

Commit ef0e87b

Browse files
authored
Force desugaring to be enabled when minSdk is < 26 due to OTel issue (#2354)
## Goal OTel `1.50.0` introduced an implicit dependency on the Java9 Clock, which doesn't exist for Android until Android 8. To workaround that, folks need to enable desugaring for their apps, which we already force folks to do when their minSdk is < 24 due to another OTel issue. This simply bumps the requirement to 26 until you can build an app with Embrace that doesn't doesn't have desugaring enabled. Folks don't need this change to make their app work - they just need to set `coreLibraryDesugaringEnabled` to true to enable desugaring and their app will work fine for Android 7 and 7.1.
2 parents f5cc099 + 17d1404 commit ef0e87b

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

embrace-gradle-plugin-integration-tests/fixtures/android-3rd-party-symbols/customLibrary/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ android {
1515
compileSdk 36
1616

1717
defaultConfig {
18-
minSdk 24
18+
minSdk 26
1919
ndk {
2020
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' // Supported architectures
2121
}

embrace-gradle-plugin-integration-tests/fixtures/android-instrumentation/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ android {
6060
defaultConfig {
6161
applicationId = "com.example.app"
6262
targetSdk = 36
63-
minSdk = 24
63+
minSdk = 26
6464
versionCode = 1
6565
versionName = "1.0"
6666
}

embrace-gradle-plugin-integration-tests/fixtures/android-local-and-3rd-party-symbols/customLibrary/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ android {
1515
compileSdk 36
1616

1717
defaultConfig {
18-
minSdk 24
18+
minSdk 26
1919
ndk {
2020
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' // Supported architectures
2121
}

embrace-gradle-plugin-integration-tests/fixtures/react-native-android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext {
3-
minSdk = 24
3+
minSdk = 26
44
compileSdk = 36
55
targetSdk = 36
66
ndkVersion = "26.1.10909125"

embrace-gradle-plugin-integration-tests/src/main/java/io/embrace/android/gradle/integration/framework/IntegrationTestExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ abstract class IntegrationTestExtension(objectFactory: ObjectFactory) {
9191
defaultConfig {
9292
applicationId = "com.example.app"
9393
targetSdk = 36
94-
minSdk = 24
94+
minSdk = 26
9595
versionCode = 1
9696
versionName = "1.0"
9797
}

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/EmbraceGradlePluginDelegate.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ class EmbraceGradlePluginDelegate {
8989

9090
if (enableDesugaring) {
9191
error(
92-
"Desugaring must be enabled when minSdk is < 24, " +
93-
"otherwise devices on Android API version < 24 will fail at runtime.\n" +
92+
"Desugaring must be enabled when minSdk is < 26, " +
93+
"otherwise devices on Android API version < 26 will fail at runtime.\n" +
9494
"You can enable desugaring by adding the following:\n" +
9595
"compileOptions\n" +
9696
"{\n" +

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/agp/AgpUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.gradle.api.tasks.TaskProvider
55

66
object AgpUtils {
77

8-
private const val MINIMUM_DESUGARING_LEVEL = 23
8+
private const val MINIMUM_DESUGARING_LEVEL = 25
99
fun isDesugaringRequired(sdkLevel: Int) = sdkLevel <= MINIMUM_DESUGARING_LEVEL
1010

1111
/**

embrace-gradle-plugin/src/test/java/io/embrace/android/gradle/plugin/util/AgpUtilsTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import org.junit.Test
1212
class AgpUtilsTest {
1313

1414
@Test
15-
fun `desugaring should not be required for min sdk level greater than 23`() {
16-
assertFalse(AgpUtils.isDesugaringRequired(24))
15+
fun `desugaring should not be required for min sdk level greater than 25`() {
16+
assertFalse(AgpUtils.isDesugaringRequired(26))
1717
}
1818

1919
@Test
20-
fun `desugaring should be required for min sdk level less than 24`() {
21-
assertTrue(AgpUtils.isDesugaringRequired(23))
20+
fun `desugaring should be required for min sdk level less than 26`() {
21+
assertTrue(AgpUtils.isDesugaringRequired(25))
2222
}
2323

2424
@Test

embrace-microbenchmark/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
compileSdk = 36
1212

1313
defaultConfig {
14-
minSdk = 24
14+
minSdk = 26
1515
testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner"
1616
testInstrumentationRunnerArguments["androidx.benchmark.dryRunMode.enable"] = "true"
1717
}

0 commit comments

Comments
 (0)