Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native internal error

I have been trying to make a simple test app using react native but I am getting this

image

Sometimes the app runs without any error but again after sometime this error pops up so cam someone please help me. Thank You!!

This is my console output:

image

And this is what I am getting in android studio logcat:

12-04 18:19:42.856 4147-4163/com.album E/unknown:ReactNative: Unable to download JS bundle
                                                          com.facebook.react.common.DebugServerException: The development server returned response error code: 500

                                                          URL: http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false

                                                          Body:
                                                          {"type":"InternalError","errors":[],"message":"Metro Bundler has encountered an internal error, please check your terminal error output for more details"}
                                                              at com.facebook.react.devsupport.BundleDownloader.processBundleResult(BundleDownloader.java:225)
                                                              at com.facebook.react.devsupport.BundleDownloader.access$100(BundleDownloader.java:40)
                                                              at com.facebook.react.devsupport.BundleDownloader$1.onResponse(BundleDownloader.java:192)
                                                              at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
                                                              at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                                                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                              at java.lang.Thread.run(Thread.java:818)
12-04 18:19:42.899 4147-4164/com.album E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb407eec0
12-04 18:19:42.902 4147-4147/com.album E/unknown:ReactNative: Exception in native call
                                                          com.facebook.react.common.DebugServerException: The development server returned response error code: 500

                                                          URL: http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false

                                                          Body:
                                                          {"type":"InternalError","errors":[],"message":"Metro Bundler has encountered an internal error, please check your terminal error output for more details"}
                                                              at com.facebook.react.devsupport.BundleDownloader.processBundleResult(BundleDownloader.java:225)
                                                              at com.facebook.react.devsupport.BundleDownloader.access$100(BundleDownloader.java:40)
                                                              at com.facebook.react.devsupport.BundleDownloader$1.onResponse(BundleDownloader.java:192)
                                                              at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
                                                              at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                                                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                              at java.lang.Thread.run(Thread.java:818)
like image 540
Satyam Rai Avatar asked Dec 04 '17 13:12

Satyam Rai


People also ask

What is react-native localize?

Localization is locating a character or restricting it to a particular place. In the case of application development, it is about developing the application according to the local language. For Localization, we will use the LocalizedStrings component of the react-native-localization library.


4 Answers

I restarted my laptop and it worked for me.

I am not saying this is the correct solution but it worked for me.

like image 106
Satyam Rai Avatar answered Nov 01 '22 12:11

Satyam Rai


Sometimes this error can occur because the application cache needs to be cleaned.

You could try to get into the Android folder in the react-native project directory and run this command:gradlew clean then go back to react-native root folder and try to run android emulator react-native run-android. Also you could try react-native start --reset-cache.

like image 42
Pedro Soares Avatar answered Nov 01 '22 10:11

Pedro Soares


Just try this line of code in your terminal

  1. sudo lsof -i :8081
  2. kill -9
like image 1
Rajesh Bhartia Avatar answered Nov 01 '22 12:11

Rajesh Bhartia


Try this

1.sudo lsof -i :<Your port>
2.Run sudo kill -9 <PID>
3.Run application again
like image 1
Dino Sunny Avatar answered Nov 01 '22 12:11

Dino Sunny