Bare Workflow: Updates.reloadAsync() makes my android app crash
See original GitHub issueHey guys, I used to work on ExpoKit and i’ve just switch to Bare Workflow with the new release (SDK 37). Everything is working fine except for the OTA update. I’m using the manual update for my application by calling the checkForUpdateAsync and the fetchUpdateAsync methods.
Those two methods are working (the update is fetched) but when i’m trying to reload my app after this with reloadAsync method my android app crashed with a strange error (on release).
Yet, when I’m restarting the application, the update is available.
This log is extracted from adb logcat --buffer=crash:
04-08 14:30:35.158 29276 29598 E AndroidRuntime: FATAL EXCEPTION: create_react_context 04-08 14:30:35.158 29276 29598 E AndroidRuntime: Process: XXXXX, PID: 29276 04-08 14:30:35.158 29276 29598 E AndroidRuntime: com.facebook.jni.CppException: facebook::react::Recoverable: Could not open file/data/user/0/XXXX/files/.expo-internal/7C6DA04432421D9566434203858FEC7C132FA97C43BD314556629A1673F750F6.js: No such file or directory 04-08 14:30:35.158 29276 29598 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromFile(Native Method) 04-08 14:30:35.158 29276 29598 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromFile(Unknown Source:2) 04-08 14:30:35.158 29276 29598 E AndroidRuntime: at com.facebook.react.bridge.JSBundleLoader$2.loadScript(Unknown Source:6) 04-08 14:30:35.158 29276 29598 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(Unknown Source:18) 04-08 14:30:35.158 29276 29598 E AndroidRuntime: at com.facebook.react.s.a(Unknown Source:154) 04-08 14:30:35.158 29276 29598 E AndroidRuntime: at com.facebook.react.s.a(Unknown Source:0) 04-08 14:30:35.158 29276 29598 E AndroidRuntime: at com.facebook.react.s$e.run(Unknown Source:68) 04-08 14:30:35.158 29276 29598 E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:13 (5 by maintainers)
Top Related StackOverflow Question
Hey @axelmarciano, I just recently faced and solved this issue. From your code, I think it’s better you do
await Updates.reloadAsync();so that you have control of what happens when thePromiseis resolved. I don’t know where you use the hook but i will just make assumptions.Most importantly, you shouldn’t run any code after
Updates.reloadAsync()such assetState()despite the documentation said it’s not recommended when actually it seems like we cannot. Refer toUpdates.reloadAsync()section in Expo Updates Doc.Another thing to watch out is if
reloadAsync()is used inApp()component where normally there are a fewuseEffect()around, ensure that no otheruseEffect()will actually do something after you callreloadAsync().What happened to me was
So I changed to something like
Have the same issue. reloadAsync make app crash