我一直在尝试使用 native react 制作一个简单的测试应用程序,但我得到了这个
有时应用程序运行没有任何错误,但一段时间后再次弹出此错误,所以请有人帮助我。谢谢!!
这是我的控制台输出:
这就是我在 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)
最佳答案
我重新启动了我的笔记本电脑,它对我有用。
我并不是说这是正确的解决方案,但它对我有用。
关于android - React Native 内部错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47634017/