I have discovered a bug in EAS build’s Android build process. My guess is that when generating strings.xml, EAS is not escaping apostrophes (and possibly other control characters) leading to the following error:
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] > Android resource compilation failed
[stderr] /build/workingdir/build/mobile/android/app/src/main/res/values/strings.xml:3:3-46: AAPT: error: unescaped apostrophe in string
[stderr]
[stderr] /build/workingdir/build/mobile/android/app/src/main/res/values/strings.xml:3:3-46: AAPT: error: not a valid string.
[stderr]
[stderr] /build/workingdir/build/mobile/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml: AAPT: error: file failed to compile.
On latest Expo and EAS clients.
To reproduce:
- expo init
- Edit app.json, change the name key to “Let’s Break Expo”
- eas build -p android
- Watch the Run gradlew step in Expo and be sad when it breaks
Workaround: Replace apostrophe with ’ (U+2019)