I'm trying to run react native for the first time on my android phone. I get a red error message on the screen which says this:
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)
I checked the terminal output, but this is all that's there:
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 } }
I've searched around for similar questions, and the proposal that I run this command:
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
is just met with another error:
EACCES: permission denied, open '/tmp/metro-cache/76/ef8540697e4672b918c42afa4d166f92f224f34ee755285a39fd0922f1d4c6739388c3'