expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
833 stars 85 forks source link

eas update not working with runtimeVersion policy appVersion #1729

Closed mhazizk closed 1 year ago

mhazizk commented 1 year ago

Build/Submit details page URL

No response

Summary

I set my expo.runtimeVersion.policy = "appVersion" with version 0.8.0-alpha and then eas build --profile production and publish it perfectly to play store.

Later on, I have a small change to update, without adding any native code, and changing expo.runtimeVersion.policy or app.json or app.config.js so the version is still the same 0.8.0-alpha and then eas update to production.

But unfortunately, there is no update shown after restarting the app with the same version twice or more.

Currently, my eas update quota is not the problem.

Is this the right way to update targeting specific appVersion? or maybe there is some fix to do it?

Managed or bare?

managed

Environment

npx expo-env-info

expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 13.1
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 18.12.0 - /usr/local/bin/node
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 8.19.2 - /usr/local/bin/npm
      Watchman: 2023.01.23.00 - /opt/homebrew/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    IDEs:
      Android Studio: 2022.1 AI-221.6008.13.2211.9619390
      Xcode: 14.2/14C18 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~47.0.13 => 47.0.13
      react: 18.1.0 => 18.1.0
      react-native: 0.70.5 => 0.70.5
    npmGlobalPackages:
      eas-cli: 3.5.2
      expo-cli: 6.2.1
    Expo Workflow: managed
expo doctor

Some dependencies are incompatible with the installed expo package version:
 - @sentry/react-native - expected version: 4.9.0 - actual version installed: 5.0.0
 - expo-linking - expected version: ~3.3.1 - actual version installed: 3.3.0
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo doctor --fix-dependencies,
or install individual packages by running expo install [package-name ...]

Error output

No response

Reproducible demo or steps to reproduce from a blank project

eas.json

{
  "cli": {
    "version": ">= 3.4.1"
  },
  "build": {
    "development-simulator": {
      "channel": "development",
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "simulator": true
      }
    },
    "development": {
      "channel": "development",
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "resourceClass": "m1-medium"
      }
    },
    "staging": {
      "channel": "staging",
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      },
      "ios": {
        "resourceClass": "m1-medium",
        "simulator": true
      }
    },
    "production": {
      "channel": "production",
      "android": {
        "buildType": "app-bundle"
      },
      "ios": {
        "resourceClass": "m1-medium"
      }
    }
  },
  "submit": {
    "production": {}
  }
}
app.json

{
  "expo": {
    "name": "Juta",
    "slug": "Juta",
    "version": "0.0.1",
    "orientation": "portrait",
    "icon": "./src/assets/icons/juta-app-icon.png",
    "userInterfaceStyle": "automatic",
    "splash": {
      "image": "./src/assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#000000"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "buildNumber": "1",
      "bundleIdentifier": "app.juta",
      "supportsTablet": true,
      "infoPlist": {
        "NSPhotoLibraryUsageDescription": "Allow $(PRODUCT_NAME) to access your photos.",
        "NSPhotoLibraryAddUsageDescription": "Allow $(PRODUCT_NAME) to save photos."
      }
    },
    "android": {
      "package": "app.juta",
      "versionCode": 1,
      "softwareKeyboardLayoutMode": "pan",
      "googleServicesFile": "./google-services.json",
      "adaptiveIcon": {
        "foregroundImage": "./src/assets/icons/juta-icon-foreground.png",
        "backgroundColor": "#000000"
      },
      "permissions": [
        "android.permission.READ_EXTERNAL_STORAGE",
        "android.permission.WRITE_EXTERNAL_STORAGE",
        "android.permission.ACCESS_MEDIA_LOCATION",
        "android.permission.RECORD_AUDIO",
        "com.google.android.gms.permission.AD_ID"
      ]
    },
    "web": {
      "favicon": "./src/assets/icons/favicon.png"
    },
    "plugins": [
      "sentry-expo",
      [
        "expo-media-library",
        {
          "photosPermission": "Allow $(PRODUCT_NAME) to access your photos.",
          "savePhotosPermission": "Allow $(PRODUCT_NAME) to save photos.",
          "isAccessMediaLocationEnabled": true
        }
      ],
      [
        "expo-image-picker",
        {
          "photosPermission": "Allow $(PRODUCT_NAME) to access your photos."
        }
      ]
    ],
    "extra": {
      "eas": {
        "projectId": "4c20a6fe-d8c0-40a2-9324-2f39af56f8a3"
      }
    },
    "runtimeVersion": {
      "policy": "appVersion"
    }
  }
}
app.config.js

module.exports = ({ config }) => {
  const name = "Juta";
  const expoProjectID = "4c20a6fe-d8c0-40a2-9324-2f39af56f8a3";

  const appVersion = "0.8.0-alpha";
  const androidVersionCode = 26;
  const iosBuildNumber = "1";

  return {
    ...config,
    name: name,
    version: appVersion,
    jsEngine: "hermes",
    android: {
      ...config.android,
      versionCode: androidVersionCode,
    },
    ios: {
      ...config.ios,
      buildNumber: iosBuildNumber,
    },
    updates: {
      ...config.updates,
      url: `https://u.expo.dev/${expoProjectID}`,
    },
    extra: {
      ...config.extra,
    },
    hooks: {
      postPublish: [
        {
          file: "sentry-expo/upload-sourcemaps",
          config: {
            organization: "mhazizk",
            project: "juta-app",
            authToken:
              "dummy_token",
          },
        },
      ],
    },
  };
};
package.json

{
  "name": "juta",
  "version": "0.5.6",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@likashefqet/react-native-image-zoom": "^1.2.1",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/datetimepicker": "6.5.2",
    "@react-navigation/bottom-tabs": "^6.5.3",
    "@react-navigation/native": "^6.1.2",
    "@react-navigation/stack": "^6.3.11",
    "@sentry/react-native": "5.0.0",
    "@types/react-native": "~0.70.6",
    "axios": "^1.2.2",
    "expo": "~47.0.13",
    "expo-application": "~5.0.1",
    "expo-constants": "~14.0.2",
    "expo-dev-client": "~2.0.1",
    "expo-device": "~5.0.0",
    "expo-file-system": "~15.1.1",
    "expo-image-picker": "~14.0.2",
    "expo-linking": "^3.3.0",
    "expo-localization": "~14.0.0",
    "expo-media-library": "~15.0.0",
    "expo-print": "~12.0.0",
    "expo-secure-store": "~12.0.0",
    "expo-sharing": "~11.0.1",
    "expo-status-bar": "~1.4.2",
    "expo-updates": "~0.15.6",
    "firebase": "^9.17.1",
    "lottie-react-native": "5.1.4",
    "react": "18.1.0",
    "react-firebase-hooks": "^5.1.1",
    "react-native": "0.70.5",
    "react-native-chart-kit": "^6.12.0",
    "react-native-country-flag": "^1.1.9",
    "react-native-fs": "^2.20.0",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-html-to-pdf": "^0.12.0",
    "react-native-markdown-view": "^1.1.4",
    "react-native-onboarding-swiper": "^1.2.0",
    "react-native-pager-view": "6.0.1",
    "react-native-purchases": "^5.8.0",
    "react-native-reanimated": "~2.12.0",
    "react-native-reanimated-carousel": "^3.1.5",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-svg": "13.4.0",
    "react-native-text-ticker": "^1.14.0",
    "react-native-uuid": "^2.0.1",
    "react-native-vector-icons": "^9.2.0",
    "sentry-expo": "~6.0.0",
    "victory-native": "^36.6.8"
  },
  "devDependencies": {
    "@babel/core": "^7.19.3",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "react-native-dotenv": "^3.4.7"
  },
  "private": true
}
quinlanj commented 1 year ago

hey @mhazizk as a sanity check, could you do checkout your app to the state which you made your build, and make an additional development build.

An example of how to do this is to run eas build --profile development while your eas.json is configured like so:

"build": {
    "development": {
      "developmentClient": true,
      ...
    },
    ...
}

When you open the app and physically shake your phone, you should be able to see a debug view and explicitly load the problematic update:

Please report back whether you are able to load this update properly. If not, let us know:

quinlanj commented 1 year ago

closing due to inactivity