react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

App always crashing on release build but crashes only once initially on debug

Open nlimbu opened this issue 7 years ago • 6 comments

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.

nlimbu avatar Jul 08 '19 19:07 nlimbu

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.

nlimbu avatar Jul 08 '19 19:07 nlimbu

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.

alexandergoncharov-zz avatar Jul 09 '19 10:07 alexandergoncharov-zz

Looks like related to https://github.com/microsoft/react-native-code-push/issues/1272

alexandergoncharov-zz avatar Jul 09 '19 10:07 alexandergoncharov-zz

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

erennyuksell avatar Jul 11 '19 18:07 erennyuksell

"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

qingjiaowochengzd avatar Dec 11 '19 02:12 qingjiaowochengzd

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.

alexandergoncharov-zz avatar Feb 14 '20 11:02 alexandergoncharov-zz