Hi, we have an ExpoKit app that was previously SDK 34 that we’re upgrading to SDK 37. Most things are working fine, but once we’re out of dev and try testing upgrading, on Android the app keeps crashing. This can be fixed by clearing local storage; after that, the app runs fine.
This is the error from logcat:
java.lang.RuntimeException: Expo encountered a fatal error: 34.0.0 is not a valid SDK version. Options are 37.0.0, UNVERSIONED.
at host.exp.exponent.experience.BaseExperienceActivity.lambda$consumeErrorQueue$0$BaseExperienceActivity(BaseExperienceActivity.java:204)
at host.exp.exponent.experience.-$$Lambda$BaseExperienceActivity$zZZNiLUhJmY4AlwF2loJATXcbqc.run(Unknown Source:2)
at android.app.Activity.runOnUiThread(Activity.java:6404)
at host.exp.exponent.experience.BaseExperienceActivity.consumeErrorQueue(BaseExperienceActivity.java:184)
at host.exp.exponent.experience.BaseExperienceActivity.addError(BaseExperienceActivity.java:73)
at host.exp.exponent.kernel.Kernel.handleReactNativeError(Kernel.java:1051)
at host.exp.exponent.kernel.Kernel.handleError(Kernel.java:1056)
at host.exp.exponent.experience.ExperienceActivity.setManifest(ExperienceActivity.java:418)
at host.exp.exponent.experience.ExperienceActivity$2$2.run(ExperienceActivity.java:221)
at host.exp.expoview.Exponent.runOnUiThread(Exponent.java:218)
at host.exp.exponent.experience.ExperienceActivity$2.onManifestCompleted(ExperienceActivity.java:215)
at host.exp.exponent.AppLoader.resolve(AppLoader.java:240)
at host.exp.exponent.AppLoader.resolve(AppLoader.java:215)
at host.exp.exponent.AppLoader.access$000(AppLoader.java:20)
at host.exp.exponent.AppLoader$5.onBundleLoaded(AppLoader.java:337)
at host.exp.expoview.Exponent$2$1.run(Exponent.java:452)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7073)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
My understanding is that this means the app is trying to run our old SDK-34-versioned JS bundle instead of the SDK 37 one it was built with (and that should have also been published). Once we clear the cached version by clearing internal storage, it pulls in the right version.
Since we’re not 100% sure of the cause, we’ve tried a few things that didn’t help:
- created a new release channel to make sure it was not serving older versions (and did this for each following change)
- updated the kernel-manifest.json file in the android directory to match the expo repo’s sdk-37 branch since that wasn’t auto-updated
- re-added
sdkVersion: "37.0.0"
to the app.json, since theexpo upgrade
tool removed that line - verified that the expo package has a version of 37+ in its package.json, and that version 34 was not mentioned anywhere else in our repo
We focused on the sdkVersion in the manifests since that seems to be where this error originates: expo/ExperienceActivity.java at sdk-37 · expo/expo · GitHub
Our app uses updates.checkAutomatically: 'ON_ERROR_RECOVERY'
to control when users get updates. Next up we’re experimenting with changing that to see if we can get the app to maybe re-download a correctly-versioned JS bundle.
Does anyone have advice to help us figure out how this should be working? By everything I can read, the app should be using the JS bundle it’s built with, or at least only download the newly-versioned-for-SDK-37 JS bundle we published.