React-native-code-push: App always crashing on release build but crashes only once initially on debug

Created on 8 Jul 2019  路  6Comments  路  Source: microsoft/react-native-code-push

I faced this issue while trying to update my project to react-native 0.59.8. The app builds just fine but crashes only once during the initial run on debug mode. However, from the second run after, everything functions properly. The release apk can be generated without any issue with gradlew assembleRelease but it crashes on every run.

It seems that the JSBundle is packaged correctly by the metro on debug but on release it cannot load the required resources correctly. In an effort to find out the cause, i commented out the function from MainApplication.java

@Override
protected String getJSBundleFile() {
  return CodePush.getJSBundleFile();
}

This stopped the app crashes on both debug and release mode which leads me to think that the cause might be the react-native-code-push library. The output of adb logcat shows Codepush activity during app initialisation.

Is this a bug?

Potentially.

Steps to Reproduce

  1. Install [email protected]
  2. link the library
  3. reat-native run-android

Expected Behavior

Build the app without any issues during inital Codepush-update.

Actual Behavior

A few second after the app starts the screen momentarily flashes (perhaps. CodePush trying to access JSBundle) and the app crashes.

app_crash

logcat_3

logcat_2

Environment

  • react-native-code-push version: 5.6.0
  • react-native version: 0.59.8
  • Ubuntu: 18.4.2 LTS
  • gradle plugin: 3.3.2
  • gradle version: 4.10.1

Currently, i have removed code-push from my project and both debug and release builds are fine.

android bug waiting-for-clarification

Most helpful comment

i have same problem too using RN version 0.59.10 after install codepush update app crash on some devices with release build.
I'm also using react-native-navigation v2

All 6 comments

This is probably not a bug because on a clean project with [email protected] and [email protected], i was not able to reproduce the same error.

Hi @softCompound,
Thanks for reporting!

Yeah, I can't reproduce it on a clear project too. Could you please provide some dummy project with reproducing issue and reprosteps? I would like to debug it.

i have same problem too using RN version 0.59.10 after install codepush update app crash on some devices with release build.
I'm also using react-native-navigation v2

"react-native": "0.55.4",
"react-native-code-push": "^5.6.0",

push new bundle then update dev app, get this error

facebook::react::Recoverable: Could not open file/data/user/0/com.*/files/ReactNativeDevBundle.js: No such file or directory

Hi @softCompound ,

I'm going to close this issue ofr now as I haven't heard from you in a while, unfortunately.
Please feel free to reopen it if you have any questions or provide more info.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaysig picture jaysig  路  3Comments

djw27 picture djw27  路  3Comments

chrisjrex picture chrisjrex  路  4Comments

sergey-akhalkov picture sergey-akhalkov  路  4Comments

quanzaiyu picture quanzaiyu  路  3Comments