java.lang.RuntimeException: Unable to load script. Make sure youre either running a Metro server (run react-native start) or that your bundle index.android.bundle is packaged correctly for release.

9
Hello, I’m trying to run the mendix 8 native builder app, but when appcentre generates the Android APK it does not actually run on the device. The error message is the following:   12-12 16:46:51.105  8701  8726 E AndroidRuntime: java.lang.RuntimeException: Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release. 12-12 16:46:51.105  8701  8726 E AndroidRuntime:     at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method) 12-12 16:46:51.105  8701  8726 E AndroidRuntime:     at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:218) 12-12 16:46:51.105  8701  8726 E AndroidRuntime:     at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:31) 12-12 16:46:51.105  8701  8726 E AndroidRuntime:     at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:247) 12-12 16:46:51.105  8701  8726 E AndroidRuntime:     at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1152) 12-12 16:46:51.105  8701  8726 E AndroidRuntime:     at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:123) 12-12 16:46:51.105  8701  8726 E AndroidRuntime:     at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:943) 12-12 16:46:51.105  8701  8726 E AndroidRuntime:     at java.lang.Thread.run(Thread.java:919)   I don’t think I should be running the react-native metro server for a production build, so the question is, how do I get it to generate that index.android.bundle correctly?
asked
2 answers
1

I was able to get this resolved by creating a custom rule in the widows firewall.  I used the following documentation to do this: https://coderwall.com/p/mbov6w/running-nodejs-and-express-on-windows

Also make sure that the project is running on port 8080. I experienced conflicts when using a custom port.

answered
0

I had the same problem and get this answer from Mendix :

Can you check the firewall settings and ensure that the Node.js entries in Inbound Rules are enabled for the Modeler versions being used?
You should be able to see the version number listed in the Program column (8.8.1.4465):
 

The public one was blocked indeed. It was solved after allow this public one.

answered