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

EAS Update引发应用异常:原有资源加载失败且自动回滚

EAS Update推送更新后资源加载异常并自动回滚

我用Expo开发应用,最近尝试通过EAS Update推送更新。严格按照官方操作步骤执行后,出现异常:新增的视图和文本(比如添加的“update version”文本)能正常显示,但应用安装包中原有的图片和图标却无法加载(本次更新并未修改这些资源)。重启应用后,会自动回滚至更新前的安装包版本。

我已经做过相关调研,还找到一个和我问题完全一致的问题,尝试了其中的解决方案,但异常仍未解决。

以下是我的配置文件:

eas.json

{
  "cli": {
    "version": ">= 3.7.2"
  },
  "build": {
    "development":{
      "env":{
        "FIREBASE_ENV":"dev"
      },
      "android": {
        "buildType": "apk"
      },
      "channel":"development"
    },
    "production": {
      "env":{
        "FIREBASE_ENV":"prod"
      },
      "android": {
        "buildType": "apk"
      },
      "channel":"production"
    },
    "development-client": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "resourceClass": "m1-medium"
      },
      "channel":"development"
    }
  },
  "submit": {
    "production": {}
  }
}

app.json

{
    "expo": {
      "name": "Bento",
      "slug": "bento",
      "version": "1.0.0",
      "orientation": "portrait",
      "icon": "./assets/icon.png",
      "splash": {
        "image": "./assets/splash.png",
        "resizeMode": "cover",
        "backgroundColor": "#131212"
      },
      "assetBundlePatterns": ["**/*"],
      "ios": {
        "supportsTablet": true
      },
      "android": {
        "adaptiveIcon": {
          "foregroundImage": "./assets/adaptive-icon.png",
          "backgroundColor": "#131212"
        },
        "googleServicesFile": "./google-services.json",
        "package": "<package name>"
      },
      "web": {
        "favicon": "./assets/favicon.png"
      },
      "plugins": [
        "@react-native-firebase/app",
        "@react-native-firebase/auth",
        "@react-native-firebase/perf",
        "@react-native-firebase/crashlytics"
      ]
    }
  }

app.config.js

module.exports = ({ config }) => {
  return {
    ...config,
    extra: {
      firebaseEnv: process.env.FIREBASE_ENV,
      eas: {
        projectId: "<project-id>"
      }
    },
    updates: {
      url: "https://u.expo.dev/<project-id>"
    },
    runtimeVersion: {
      policy: "sdkVersion"
    },
  };
};

package.json

{
  "name": "bento",
  "version": "1.0.0",
  "keywords": [
    "react",
    "expo",
    "template",
    "nativebase"
  ],
  "license": "MIT",
  "scripts": {
    "start:development": "SET FIREBASE_ENV=dev&&expo start --dev-client",
    "start:production": "set FIREBASE_ENV=prod&&expo start --dev-client",
    "build:dev-client": "eas build --profile development-client --platform android",
    "build:development": "eas build --profile development --platform android ",
    "build:production": "eas build --profile production --platform android",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "start": "expo start --dev-client"
  },
  "dependencies": {
    "@expo-google-fonts/poppins": "^0.2.3",
    "@react-native-community/netinfo": "9.3.7",
    "@react-native-firebase/app": "^17.3.2",
    "@react-native-firebase/auth": "^17.3.2",
    "@react-native-firebase/crashlytics": "^17.3.2",
    "@react-native-firebase/firestore": "^17.3.2",
    "@react-native-firebase/in-app-messaging": "^17.3.2",
    "@react-native-firebase/messaging": "^17.3.2",
    "@react-native-firebase/perf": "^17.3.2",
    "@react-native-google-signin/google-signin": "^9.0.2",
    "@react-navigation/drawer": "^6.6.2",
    "@react-navigation/native": "^6.1.6",
    "@react-navigation/stack": "^6.3.16",
    "axios": "^1.3.4",
    "dotenv": "^16.0.3",
    "expo": "~48.0.6",
    "expo-constants": "~14.2.1",
    "expo-dev-client": "~2.1.5",
    "expo-device": "~5.2.1",
    "expo-font": "~11.1.1",
    "expo-notifications": "~0.18.1",
    "expo-splash-screen": "~0.18.1",
    "expo-status-bar": "~1.4.4",
    "native-base": "3.4.0",
    "nativewind": "^2.0.11",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.71.3",
    "react-native-dropdown-picker": "^5.4.6",
    "react-native-gesture-handler": "~2.9.0",
    "react-native-reanimated": "~2.14.4",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.20.0",
    "react-native-svg": "12.1.1",
    "react-native-web": "~0.18.11",
    "tailwindcss": "^3.2.7",
    "expo-updates": "~0.16.3"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "react-native-dotenv": "^3.4.8"
  },
  "private": true
}

内容的提问来源于stack exchange,提问作者Devesh Meena

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.27 22:14:59