Metro Bundler遇到内部错误

时间:2018-07-10 00:03:47

标签: android react-native

我正在尝试在我的Android手机上首次运行本机响应。 我在屏幕上收到一条红色错误消息,内容为:

The development server returned response error code: 500
URL: http://localhost:8081 /index.delta ?platform =android&dev=true&minify=false
Body:
{“type”:”lnternal Error”,’errors”:
W’message”:”Metro Bundler has encountered an internal error, please check your terminal error output for more details }
processBundleResult
BundleDownloader .java :285
access$200
BundleDownloader .java :37
onResponse
BundleDownloader .java : 163
execute -
RealCall.java:153
run
NamedRunnable.java :32
runWorker
ThreadPoolExecutor .java: 1133
run
ThreadPoo1Excutor . java :607
DISMISS RELOAD COPY
(ESC) (R, R)

我检查了终端输出,但这就是全部了:

react-native run-android
Scanning folders for symlinks in /home/max/ReactNativeProjects/LukeProjectTwo/node_modules (8ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

> Configure project :app 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

[adb]: * daemon not running; starting now at tcp:5037
[adb]: * daemon started successfully

> Task :app:installDebug 
Installing APK 'app-debug.apk' on 'SM-G950U - 7.0' for app:debug
Installed on 1 device.


BUILD SUCCESSFUL in 26s
27 actionable tasks: 8 executed, 19 up-to-date
Running /home/max/Android/Sdk/platform-tools/adb -s 98882045384b334a4a reverse tcp:8081 tcp:8081
adb server version (36) doesn't match this client (40); killing...
* daemon started successfully
Starting the app on 98882045384b334a4a (/home/max/Android/Sdk/platform-tools/adb -s 98882045384b334a4a shell am start -n com.lukeprojecttwo/com.lukeprojecttwo.MainActivity)...
Starting: Intent { cmp=com.lukeprojecttwo/.MainActivity launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } }

我搜索了类似的问题以及运行此命令的建议:

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

遇到另一个错误:

EACCES: permission denied, open '/tmp/metro-cache/76/ef8540697e4672b918c42afa4d166f92f224f34ee755285a39fd0922f1d4c6739388c3'

1 个答案:

答案 0 :(得分:0)

尝试一下:
1-CD android然后./gradlew clean。
2-返回到根项目文件夹和“ react-native start --reset-cache”

相关问题