React Native Crash Undefined 不是对象(评估 'Sn[e]') [英] React Native Crash Undefined is not an object (Evaluating 'Sn[e]')
问题描述
有人面临反应原生构建问题吗?我正在尝试生成调试版本,但在应用程序启动时它崩溃了.
异常没有有用的信息.
我遇到了同样的问题
sudo react-native run-android
但是在将 RN 从 0.48 升级到 0.55(最新稳定版)后问题得到了解决
但是对于使用
生成的 apk 崩溃保持不变sudo gradlew assembleDebug
崩溃类似于
经过这么多的挣扎,从不同来源寻找解决方案,我开始知道 assembleDebug 本身并不是捆绑的.因此,使用以下命令显式捆绑它的资产
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --资产目标 android/app/src/main/res/
然后生成构建
sudo gradlew assembleDebug
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
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
这篇关于React Native Crash Undefined 不是对象(评估 'Sn[e]')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!