androidreact-nativeexpoversioneas

EAS ignoring local versionCode in build


I recently updated our Expo project from sdk 44 to 46. During that process, I switched from Expo build:android to eas build -p android.

Everything is running as expected, except the version code is not compiled into the aab/apk files correctly, so I cant push updates to google play.

The version code is already set to 26, as we did release previous versions, and the semVer is 1.1.1 currently. EAS also doesn't show the correct version codes in the dashboard. I tried setting "appVersionSource": "local" as well as "remote", but neither works. (As far as I understand, local should be the correct parameter.

eas build generally seems to ignore other parameters from the app.config.js, like the splash images, app icons and background colors (I didn't include those lines in the code examples below to keep it short)

eas.json

{
  "cli": {
    "version": ">= 2.3.0",
    "appVersionSource": "local"
  },
  "build": {
    ...
    "production": {
      "channel": "production",
      "env": {
        "APP_ENV": "production"
      },
      "android": {
        "buildType": "app-bundle",
        "image": "latest"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

app.config.js

import 'dotenv/config';
    
module.exports = {
  expo: {
    name: '...',
    slug: '...',
    version: '1.1.1',
    assetBundlePatterns: ['**/*'],
    android: {
      package: '...',
      versionCode: 26,
      softwareKeyboardLayoutMode: 'pan',
    },
    extra: {
      eas: {
        projectId: '...',
      },
      releaseChannel: process.env.APP_ENV,
    },
  },
};

Eas showing the wrong version nr

Eas shows the wrong version nr


Solution

  • Try running npx expo prebuild or npx expo run:android That would generate the native Android project, which is basically like the Bare workflow.

    See the following post for some more details and what you can do: https://forums.expo.dev/t/should-i-exclude-ios/63094/4