question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

app.json fields seem to always be at last published versions instead of being built into the bundle

See original GitHub issue

In my app, I show the current version/build number as a tool to check that I’ve uploaded the right thing into the App Store.

I query the app build number with this code:

const { version } = Expo.Constants.manifest
const { buildNumber } = Expo.Constants.manifest.ios

Now that I’ve uploaded multiple versions of my app to the App Store, I notice that each version (obviously with different build #) in fact all show that they’d all be whatever is the most recent version published with exp.

As I specified isRemoteJSEnabled:false, I expected this information to be also built into app bundle.

Environment

Environment: OS: macOS High Sierra 10.13.3 Node: 9.5.0 Yarn: 1.3.2 npm: 5.6.0 Watchman: Not Found Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found

Packages: (wanted => installed) expo: ^25.0.0 => 25.0.0 react: 16.2.0 => Not Found react-native: 0.52.0 => 0.52.0

Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/nurpax-98d99231-de75-4126-932e-d21a354a0376.tar.gz

Targeting iOS, standalone app on app store.

Steps to Reproduce

(Write your steps here:)

  1. Write an app with version 1.0.0 with build #1. Specify isRemoteJSEnabled:false in app.json.
  2. In the app, display the version number and build # by reading Expo.Constants.manifest
  3. exp publish and exp build:ios the app, upload to the App Store.
  4. Bump up the build number to #2.
  5. exp publish and exp build:ios the app, upload to the App Store.

When loading different versions of the app with TestFlight, both app build versions will report being at build #2. Even though I’d expect the TestFlight build #1 to show whatever version number it was built with.

Expected Behavior

I totally expected that with isRemoteJSEnabled:false any metadata that I specifify in app.json would be built into the app bundle that I upload to the app store.

If I have uploaded build #1 to the App Store, and submitted it to the Application review, I would expect it to not change in anyway while I upload newer versions to the App Store for testing via TestFlight.

Actual Behavior

When I install an older build via TestFlight, it’s values in Expo.Constants.manifest change to whatever was previously published with exp. I would expect the old builds on the app store to stay the same regardless of what new versions I upload later.

Reproducible Demo

Making a repro case should be as easy as:

  • make new project with CRNA
  • upload multiple different builds on the app store
  • run each different version using TestFlight and observe the value of the version and build number.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
terriblebencommented, Mar 8, 2018

Hi, you should use Constants.platform.ios.buildNumber, which will always read the embedded CFBundleVersion from Info.plist.

1reaction
SteveAquinocommented, Jul 4, 2018

@nurpax @msevestre It sounds like a misunderstanding of how publishing and releasing on expo works. By default, when you run exp build:ios or exp build:android, it first runs exp publish behind the scenes. This pushes a new build to Expo’s server, allowing that version to be available immediately to users via Over the Air Updates. You can read more about it here: https://docs.expo.io/versions/latest/guides/configuring-ota-updates

I also disliked the idea of new versions automatically being pushed to end users, so I’ve disabled automatic updates and I now import the Updates module so I can still get Over the Air updates when running the app in “staging” mode, eg in TestFlight and Internal Tests. When I build the app for production, I pass --release-channel=production, which creates a build without over the air updates that get’s downloaded by end users. This is great because we can iterate on a release with test users without having to build and push to the App/Play Store on each change, but still require users to download the final release version so that updates are predictable for users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

app.json / app.config.js - Expo Documentation
The bundle for the iOS version of your app will be written to this path during publish. The bundle identifier for your iOS...
Read more >
Advanced field editing using JSON | Cloud automation Cloud
The More options field on automation actions in Jira Cloud allow you to specify a valid JSON object reference and edit issue fields....
Read more >
Can't get rid of missing manifest.json error - Stack Overflow
If I view my app in Edge, I don't see the missing manifest.json error so this error seems to be contained to Chrome...
Read more >
Understanding JSON Schema
At its heart, JSON is built on the following data structures: ... version of the JSON Schema specification the schema is written to....
Read more >
6 Oracle Visual Builder Issues
Review Oracle Visual Builder issues in Oracle Integration. ... screenshot of mobile app Bundle ID in iOS Build Configuration tab. Copy the App...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found