React Native 0.57 Android app crashes on Launch in release mode

Viewed 3470

So the issue is that we need to build with the later versions of react so it can be built with API level 26 or higher as is now required for new apps submitted to Google Play.

It appears to be that it is an issue in which babelHelpers are not loaded properly in release builds. I just have no idea how to fix it as all things I have found seem to not solve the issue. The logcat of the crashing app is below for reference.

     E/ReactNativeJS: undefined is not a function (evaluating 'babelHelpers.applyDecoratedDescriptor(t.prototype,"notificationsEnabled",[Ve.serializable],{configurable:!0,enumerable:!0,writable:!0,initializer:null})')
09-17 12:32:48.301 11704-11758/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.***********, PID: 11704
    com.facebook.react.common.JavascriptException: undefined is not a function (evaluating 'babelHelpers.applyDecoratedDescriptor(t.prototype,"notificationsEnabled",[Ve.serializable],{configurable:!0,enumerable:!0,writable:!0,initializer:null})'), stack:
    <unknown>@820:1833
3 Answers

So I filed a bug report with react-native and got a response that solved the problem. https://github.com/facebook/react-native/issues/19955#issuecomment-421295617

Basically, the new changes flubbed up a bunch of things. They are going to fix issues in a later release but have a workaround to manually force the decorator imports needed. I assume that similar workarounds are available for other issues with babelHelpers not importing properly as well.

I had the same issue, you could try update Android JSC:

https://www.npmjs.com/package/jsc-android

But this would set your minimum Andoird SKD build for 21+.

In my case that wouldn't be possible, my client demands SKD 18+, so I had to downgrade my react-native version to 0.55.4, and that solved the issue.

I had the same issue in release mode but for iOS and the reason was a library "react-native-image-crop-picker". I have got the following logs from my device:

Termination Description: DYLD, Library not loaded: @rpath/QBImagePicker.framework/QBImagePicker | Referenced from: /var/containers/Bundle/Application/2590E70F-7532-45BC-9FE1-BAC/MyApp.app/MyApp | Reason: image not found

And I have fixed it by using this solution: https://github.com/ivpusic/react-native-image-crop-picker/issues/204#issuecomment-306765126

My dependencies:

"react": "16.5.0",
"react-native": "0.57.0",
"react-native-image-crop-picker": "0.21.2",
Related