Skip to content

Commit 37c079d

Browse files
committed
fix: detox desugaring issues
1 parent fa8c3ed commit 37c079d

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

example/.detoxrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ module.exports = {
5959
type: 'ios.simulator',
6060
device: {
6161
type: 'iPhone 16 Pro',
62+
os: 'iOS 18.5',
6263
},
6364
},
6465
attached: {
@@ -70,7 +71,7 @@ module.exports = {
7071
emulator: {
7172
type: 'android.emulator',
7273
device: {
73-
avdName: 'Pixel_8_API_35',
74+
avdName: 'Pixel_9_Pro_API_35',
7475
},
7576
},
7677
},

example/android/app/build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ react {
7676
*/
7777
def enableProguardInReleaseBuilds = true
7878

79-
80-
/**
81-
* Desugaring is required to be set on from navigation-sdk version 6.3.0 onwards.
82-
* Note that this enableDesugaring currently affects Detox testing with release builds.
83-
*/
84-
def enableDesugaring = true
85-
8679
/**
8780
* The preferred build flavor of JavaScriptCore (JSC)
8881
*
@@ -132,7 +125,6 @@ android {
132125
}
133126
}
134127
compileOptions {
135-
coreLibraryDesugaringEnabled enableDesugaring
136128
sourceCompatibility JavaVersion.VERSION_17
137129
targetCompatibility JavaVersion.VERSION_17
138130
}
@@ -156,9 +148,6 @@ dependencies {
156148

157149
// Include the Google Navigation SDK.
158150
implementation 'com.google.android.libraries.navigation:navigation:6.3.1'
159-
160-
// Desugar Java 8+ APIs
161-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.3'
162151
}
163152

164153
secrets {

example/android/build.gradle

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/**
16+
* Desugaring is required to be set on from navigation-sdk version 6.3.0 onwards.
17+
* Note that this enableDesugaring currently affects Detox testing with release builds.
18+
*/
19+
def enableDesugaring = true
20+
1521
buildscript {
1622
ext {
1723
buildToolsVersion = "35.0.0"
18-
// If minSDKVersion is set below 34, make sure to enable desugaring
19-
// to use certain Java 8+ APIs on lower API levels
20-
// by setting enableDesugaring true in app/build.gradle file.
2124
minSdkVersion = 34
2225
compileSdkVersion = 35
2326
targetSdkVersion = 34
@@ -35,11 +38,28 @@ buildscript {
3538
}
3639

3740
allprojects {
38-
repositories {
39-
maven {
40-
url("$rootDir/../node_modules/detox/Detox-android")
41-
}
41+
repositories {
42+
maven {
43+
url("$rootDir/../node_modules/detox/Detox-android")
44+
}
4245
}
43-
}
46+
47+
subprojects {
48+
afterEvaluate { project ->
49+
if (project.hasProperty('android')) {
50+
android {
51+
compileOptions {
52+
coreLibraryDesugaringEnabled enableDesugaring
53+
}
54+
}
55+
56+
dependencies {
57+
// Desugar Java 8+ APIs
58+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.3'
59+
}
60+
}
61+
}
62+
}
63+
}
4464

4565
apply plugin: "com.facebook.react.rootproject"

0 commit comments

Comments
 (0)