E/unknown:React: Exception in native call

2019-07-14 02:07发布

I run android app via emulator, but got some error like below.

Don't know how to fix it.

Is there someone who know the solution?

please help.

thanks.

E/unknown:React: Exception in native call
                                                                            java.lang.RuntimeException: Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged correctly or you're running a packager server.
                                                                                at com.facebook.react.cxxbridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
                                                                                at com.facebook.react.cxxbridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:198)
                                                                                at com.facebook.react.cxxbridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:33)
                                                                                at com.facebook.react.cxxbridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:216)
                                                                                at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:994)
                                                                                at com.facebook.react.ReactInstanceManager.access$600(ReactInstanceManager.java:109)
                                                                                at com.facebook.react.ReactInstanceManager$4.run(ReactInstanceManager.java:746)
                                                                                at java.lang.Thread.run(Thread.java:818)

2条回答
可以哭但决不认输i
2楼-- · 2019-07-14 02:57

Possible Duplicate of this question. Try running this command from root directory of your project.

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
查看更多
Deceive 欺骗
3楼-- · 2019-07-14 03:02

I encountered the same problem.

I resolve this, by deleting the dependency in android\settings.gradle file. That not specified in the build.gradle file.

This fix my problem. Hope this helps you.

查看更多
登录 后发表回答