Using Realm and Remote Debugging fails on android

Viewed 2876

Importing and using Realm on react native works fine for iOS. Android also works in terms of functionality, however, when using remote debugging on chrome the following error yields.

enter image description here

I've looked around almost everywhere and nobody seems to have a clear cut answer for this. Anyone here that has managed to get out of this pit? Remote debugging is quite essential as the app is dealing with rather complex objects and using react-native log-ios is a little hard on the workflow.

Thanks all.

6 Answers

Easy fix is to goto node_modules/realm/lib/browser/rpc.js and replace line 216 with let url = 'http://127.0.0.1:8083/' + command;

I was able to resolve this issue in my pixel_3XL simulator android API level : 29

reset the path for platform-tools changed my PATH to platform-tools

$ export PATH=${PATH}:/root/Android/Sdk/platform-tools

$ adb kill-server
$ adb root                      #will give root access for adb

$ adb forward tcp:8082 tcp:8082 
$ adb reverse tcp:8081 tcp:8081

$ react-native run-android      #restart the server with a debugger enabled

voila, it worked in my machine... good luck.

additionaly try changing the ip to 127.0.0.1 and port manually in app's Developer menu -> Dev settings -> Debug server host & port

Doing this worked for me

on terminal:

adb reverse tcp:8081 tcp:8081
adb forward tcp:8082 tcp:8082
adb forward tcp:8083 tcp:8083
Related