Expo EAS Android构建失败:已用expo-splash-screen仍提示Theme.App.SplashScreen缺失
解决Expo Android构建报错:style/Theme.App.SplashScreen 未找到
问题分析
报错核心是expo-splash-screen未正确生成Theme.App.SplashScreen主题资源,或是AndroidManifest.xml引用了该主题但资源未被注入。结合你已尝试的操作,重点从依赖、配置完整性、缓存三方面排查。
解决方案
更新
expo-splash-screen并确认配置完整性
先升级到最新版本:yarn add expo-splash-screen@latest # 或 npm install expo-splash-screen@latest检查
app.json中的splash配置,确保必填项齐全:{ "expo": { "splash": { "image": "./assets/splash.png", "resizeMode": "contain", "backgroundColor": "#ffffff" } } }缺失
backgroundColor或图片路径错误会导致预构建跳过主题生成。修复
expo doctor不通过项
自动修复依赖冲突:npx expo doctor --fix-dependencies手动解决剩余警告(如SDK版本不兼容、缺失依赖),未解决的问题会阻碍预构建生成完整资源。
检查并补全主题资源
打开预构建生成的android/app/src/main/AndroidManifest.xml,确认<activity>的android:theme属性为@style/Theme.App.SplashScreen。若styles.xml中无该主题,手动添加:<style name="Theme.App.SplashScreen" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:background">@drawable/splash_screen</item> </style>清除本地与远程构建缓存
清除EAS远程缓存(若使用EAS Build):eas build --clear-cache本地重新预构建:
npx expo prebuild --clean --no-install
验证操作
完成后重新执行构建:
npx expo prebuild --clean eas build --platform android --profile preview
内容的提问来源于stack exchange,提问作者Işıl Bardakcı
相关产品推荐
相关产品推荐

