Skip to content

Commit e62ec62

Browse files
kraenhansenclaude
andcommitted
Fix build-from-source on Windows: use JVM temp dir instead of hardcoded /tmp
The intermediate container projects :packages and :packages:react-native are declared with projectDir = file("/tmp") to satisfy Gradle 9's requirement that every project in a path have an existing folder. "/tmp" is not an absolute path on Windows, so Gradle resolves it to a non-existing <rootDir>\tmp and build-from-source fails at configuration time. Use the JVM temp dir instead, which exists on every platform. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F7Mx2sWYCbJMwyTXaiXjbQ
1 parent 20d04ae commit e62ec62

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/react-native/settings.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ project(":packages:react-native:ReactAndroid:hermes-engine").projectDir =
3434
// As we build :packages:react-native:ReactAndroid, we need to declare the folders
3535
// for :packages and :packages:react-native as well as otherwise the build from
3636
// source will fail with a missing folder exception.
37+
// We point them at the JVM temp dir rather than a hardcoded "/tmp": the latter is
38+
// not an absolute path on Windows, where Gradle would resolve it to a
39+
// non-existing <rootDir>\tmp and fail at configuration time.
3740

38-
project(":packages").projectDir = file("/tmp")
41+
project(":packages").projectDir = file(System.getProperty("java.io.tmpdir", "/tmp"))
3942

40-
project(":packages:react-native").projectDir = file("/tmp")
43+
project(":packages:react-native").projectDir = file(System.getProperty("java.io.tmpdir", "/tmp"))

0 commit comments

Comments
 (0)