Skip to content

Commit 3b4ffb5

Browse files
sunnylqmclaude
andcommitted
fix(e2e-android): read detox gradle version from node_modules, not a literal
The hardcoded 20.50.1 survived the detox bump; the local Detox-android maven dir only ships the installed version's artifacts, so gradle fell through to remote repos and choked on a 404 page as a POM. Resolving the version from node_modules/detox/package.json makes future bumps a one-place change. Verified: :app:dependencies resolves com.wix:detox:20.51.4. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d4843a1 commit 3b4ffb5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Example/e2etest/android/app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ android {
109109
}
110110

111111

112-
def detoxVersion = "20.50.1"
112+
// 与 node_modules 里的 detox 保持同版:硬编码曾在 20.50→20.51 升级时
113+
// 让 gradle 去远端仓库找不存在的 POM
114+
def detoxVersion = new groovy.json.JsonSlurper().parse(file("$rootDir/../node_modules/detox/package.json")).version
113115

114116
repositories {
115117
maven {

Example/e2etest/scripts/create-rn077-oldarch-project.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function configureAndroidOldArchitecture() {
149149
appBuildGradle = appBuildGradle.replace(
150150
/dependencies \{\n/,
151151
[
152-
'def detoxVersion = "20.50.1"',
152+
'def detoxVersion = new groovy.json.JsonSlurper().parse(file("$rootDir/../node_modules/detox/package.json")).version',
153153
'',
154154
'repositories {',
155155
' maven {',

0 commit comments

Comments
 (0)