Skip to content

Commit 1381c18

Browse files
committed
fix(ci): stop a bare gradle.properties append from corrupting the last line
expo prebuild's generated android/gradle.properties has no trailing newline, so `echo "org.gradle.jvmargs=-Xmx4g" >> gradle.properties` appended directly onto its last line instead of a new one, producing expo.inlineModules.watchedDirectories=[]org.gradle.jvmargs=-Xmx4g. Gradle's JSON.parse of that property then fails at configure time, before any real compilation runs -- the exact "Process 'command 'node'' finished with non-zero exit value 1" failure this branch hit on Android Release and the Smoke Tests fixture-app fallback build. This was a dormant bug: the Android build-cache job only runs on a fingerprint miss, and no PR had changed the test-app's native dependencies in a while. Adding expo-secure-store (#2282's keychain fixture) was enough to trigger it. Reproduced locally against a clean install with the exact CI script, confirmed the corrupted property, and confirmed the printf-based fix builds cleanly (870/870 tasks).
1 parent 98ff05d commit 1381c18

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎.github/actions/setup-fixture-app/action.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ runs:
172172
run: |
173173
set -euo pipefail
174174
pnpm --dir examples/test-app exec expo prebuild --platform android --no-install
175-
echo "org.gradle.jvmargs=-Xmx4g" >> examples/test-app/android/gradle.properties
175+
# expo prebuild's generated gradle.properties has no trailing newline, so a bare
176+
# `echo >>` corrupts its last line (e.g. `expo.inlineModules.watchedDirectories=[]org.gradle.jvmargs=...`),
177+
# which fails Gradle's JSON.parse of that property at configure time. Lead with a newline.
178+
printf '\n%s\n' 'org.gradle.jvmargs=-Xmx4g' >> examples/test-app/android/gradle.properties
176179
(
177180
cd examples/test-app/android
178181
./gradlew :app:assembleRelease

‎.github/workflows/test-app-build-cache.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ jobs:
188188
run: |
189189
set -euo pipefail
190190
pnpm --dir examples/test-app exec expo prebuild --platform android --no-install
191-
echo "org.gradle.jvmargs=-Xmx4g" >> examples/test-app/android/gradle.properties
191+
# expo prebuild's generated gradle.properties has no trailing newline, so a bare
192+
# `echo >>` corrupts its last line (e.g. `expo.inlineModules.watchedDirectories=[]org.gradle.jvmargs=...`),
193+
# which fails Gradle's JSON.parse of that property at configure time. Lead with a newline.
194+
printf '\n%s\n' 'org.gradle.jvmargs=-Xmx4g' >> examples/test-app/android/gradle.properties
192195
(
193196
cd examples/test-app/android
194197
./gradlew :app:assembleRelease

0 commit comments

Comments
 (0)