You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Expo EAS Android构建失败:已用expo-splash-screen仍提示Theme.App.SplashScreen缺失

解决Expo Android构建报错:style/Theme.App.SplashScreen 未找到

问题分析

报错核心是expo-splash-screen未正确生成Theme.App.SplashScreen主题资源,或是AndroidManifest.xml引用了该主题但资源未被注入。结合你已尝试的操作,重点从依赖、配置完整性、缓存三方面排查。

解决方案

  1. 更新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或图片路径错误会导致预构建跳过主题生成。

  2. 修复expo doctor不通过项
    自动修复依赖冲突:

    npx expo doctor --fix-dependencies
    

    手动解决剩余警告(如SDK版本不兼容、缺失依赖),未解决的问题会阻碍预构建生成完整资源。

  3. 检查并补全主题资源
    打开预构建生成的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>
    
  4. 清除本地与远程构建缓存
    清除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ı

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 17:07:05