fix(android): strip dangling splashscreen_logo reference#666
Merged
Conversation
expo-splash-screen always writes windowSplashScreenAnimatedIcon -> @drawable/splashscreen_logo into styles.xml, but only generates that drawable when an image is configured. Our splash is color-only (logo is handled in JS by SplashOverlay), so a clean Android prebuild produced a dangling reference and failed resource linking: error: resource drawable/splashscreen_logo not found Add a config plugin that removes the icon item after expo-splash-screen runs (listed before it so its withAndroidStyles mod runs last). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
npx eas build --profile preview --platform android --localfailed during:app:processReleaseResources:expo-splash-screen56.0.10 always writeswindowSplashScreenAnimatedIcon → @drawable/splashscreen_logointoandroid/app/src/main/res/values/styles.xml, but only generates that drawable when animage/drawableis configured. Our splash config is color-only by design (the animated logo is rendered in JS bySplashOverlay), so a clean prebuild produced a dangling reference and aapt linking failed.The committed-but-gitignored
android/folder was stale (from an older Expo that usedwindowBackground+ shipped the PNGs), which masked this locally — EAS does a clean prebuild, so it broke there.Fix
plugins/withAndroidSplashNoIcon.js— config plugin that removes the danglingwindowSplashScreenAnimatedIconitem afterexpo-splash-screenruns. Throws if the item isn't found, so a future SDK change won't silently no-op.app.config.js— plugin listed beforeexpo-splash-screen. Expo runs the most-recently-registered mod first, so an earlier-listed plugin'swithAndroidStylesmod runs last (after expo-splash-screen has written its style items).Native splash stays color-only as intended; no new assets needed.
Verification
expo prebuild --platform android --clean— confirmedwindowSplashScreenAnimatedIcon/splashscreen_logono longer appear in generatedstyles.xml.npx eas build --profile preview --platform android --local—:app:processReleaseResourcespasses and the build producesapp-release.apk.🤖 Generated with Claude Code