React Native Crash Undefined is not an object (Evaluating 'Sn[e]')

半腔热情 提交于 2019-12-11 02:34:26

问题


Any one facing react native build issue? I am trying to generate debug build but its crashing when the app is launched .

The exception has no useful information.

I was facing the same issue with

sudo react-native run-android

But that got resolved after upgrading RN from 0.48 to 0.55(latest Stable Version)

But the crash remain same for the apk generated using

sudo gradlew assembleDebug

The crash is similar to https://github.com/facebook/react-native/issues/16745

please see screenshot


回答1:


After so much struggle , finding solutions from different sources , I got to know that assembleDebug is not bundling by itself. So bundle it assets explicitly using below command

 react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

and then generate build

sudo gradlew assembleDebug


来源:https://stackoverflow.com/questions/50372142/react-native-crash-undefined-is-not-an-object-evaluating-sne

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!