Build process does not pick up version number when read from external file

In my app.config.js I have the following

const version = parseInt(fs.readFileSync("./version.txt"), 10)
export default {
  expo: {
    version: `0.0.${version}`,

This works fine in development and the correct version is visible within the app. However when running

expo build:ios -t archive --no-publish

or the Android equivalent, then the Expo build system does not pick up the version number in version.txt and instead seems to use the most recent version I built before moving to the version.txt system.

this is because of the --no-publish flag. expo build relies on the manifest (i.e. app.json configuration) of the last publish, so by not publishing, you’re relying on the manifest from whenever the last time you published is (and not the current values in that file)

We’ve addressed this limitation in EAS Build

Thanks, this resolve the issue nicely!

In case it’s of interest to the Expo team, my motivation for wanting to use --no-publish is that I wanted to avoid OTA updates with this particular release.

fwiw, eas build does not require publishing updates. we’re moving in that direction and i’d suggest giving it a try :slight_smile:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.