React-native-code-push: [android 8] App Crashes if target version doesn't match actual app version

Created on 9 Oct 2018  路  7Comments  路  Source: microsoft/react-native-code-push

Steps to Reproduce

  1. Make a release to CodePush, let's suppose its "Target Version" is 1.0.0
  2. Make a android release to Play Store, make sure its version is higher, say 1.0.1
  3. Start the android app

Expected Behavior

It should download a patch that matches the current app version.
If none exists, it should use the bundled script instead.

Actual Behavior

App crashes:

Fatal Exception: java.lang.IllegalArgumentException
Unable to find JSIModule for class interface com.facebook.react.bridge.UIManager

com.facebook.react.bridge.JSIModuleRegistry.getModule (JSIModuleRegistry.java:17)
com.facebook.react.bridge.CatalystInstanceImpl.getJSIModule (CatalystInstanceImpl.java:478)
com.facebook.react.uimanager.UIManagerHelper.getUIManager (UIManagerHelper.java:32)
com.facebook.react.uimanager.UIManagerModule.dispatchViewManagerCommand (UIManagerModule.java:597)
java.lang.reflect.Method.invoke (Method.java)

Environment

  • react-native-code-push version: 5.4.2
  • react-native version: 0.56.0
  • iOS/Android/Windows version: android 8 (not sure about ios and windows)
  • Does this reproduce on a debug build or release build? signed release build only
  • Does this reproduce on a simulator, or only on a physical device? both

Also see: https://github.com/facebook/react-native/issues/20636#issuecomment-425248856

android waiting-for-clarification

Most helpful comment

I think play store is not important. But release build (signed) and Android 8 should be the key points.

Ahh, sorry I believe I missed one important observation.
The app may not crash at the very beginning. On my particular app, it sometimes crashes when user clicks on a password TextInput and sometimes when a button is pressed.

All 7 comments

Hi @kevinresol! Please could you provide step by step scenario that I could reproduce the issue (especially sequence of steps with changing target versions)?

May I know which part is not clear in the "Steps to Reproduce" section?

Anyway I will try my best:

  1. Make a release to CodePush, let's suppose its "Target Version" is 1.0.0
  2. Make a android release to Play Store, make sure its version is higher, say 1.0.1
  3. Start the android app (and it will crash)
  4. Make a release to CodePush, make sure its "Target Version" matches the app version (i.e. 1.0.1)
  5. Start the android app (and it will not crash)

Here is my steps:

  1. react-native init Issue1426 --version 0.56.0
  2. cd Issue1426
  3. yarn add react-native-code-push@$5.4.2
  4. code-push app add Issue1426-Android android react-native
  5. react-native link react-native-code-push
  6. code-push release-react Issue1426-Android android -t 1.0.0
  7. opened project in AndroidStudio; changed versionCode to 2 and versionName to 1.0.1; switched to release build variant; configured singing section and run app on real device.
  8. performed check for updates. Result: no updates as target version doesn't match app version
  9. code-push release-react Issue1426-Android android -t 1.0.1
  10. performed check for updates. Result: update was downloaded and successfully applied

You mentioned Play Store. Unfortunately we have no opportunity to post test apps for every issue there. Is it important step? I'm sure that this issue can be reproduced without posting app there.

Please check my steps if I missed something.

I think play store is not important. But release build (signed) and Android 8 should be the key points.

Ahh, sorry I believe I missed one important observation.
The app may not crash at the very beginning. On my particular app, it sometimes crashes when user clicks on a password TextInput and sometimes when a button is pressed.

Please add required steps in my sequence that I could reproduce the issue. It could be very helpful if you provide us with a demo app

Hey! I'm going to close this issue as there is no activity here. Should you still have any questions, you can reopen the issue or if you prefer you can create a new one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DeDuckProject picture DeDuckProject  路  3Comments

sergey-akhalkov picture sergey-akhalkov  路  4Comments

djw27 picture djw27  路  3Comments

EdmundMai picture EdmundMai  路  4Comments

kevando picture kevando  路  4Comments