4

I'm using WebStorm IDE for develop my React Native Android project. I have followed these steps in their website. But there is no way to connect with Emulator. When I run the project it show bellow error.

enter image description here


Update

enter image description here

enter image description here

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Tje123
  • 729
  • 17
  • 44
  • For android you specifically have to run emulator first before runing project. – Ankit Aggarwal Jun 07 '17 at 05:55
  • yes i have run emulator from command line.but this error showing – Tje123 Jun 07 '17 at 05:57
  • is realm linked properly? Can you try running: react-native link realm. – Ankit Aggarwal Jun 07 '17 at 06:08
  • now Emulator is runnig.what i have did is 1) run emulator from cmd.[run from cmd](https://developer.android.com/studio/build/building-cmdline.html). 2) set port to emulator (emulator -port 8081 -avd Nexus_5X_API_23).now emulator is running but showing red error on emulator `Error calling Appregistry.runApplication` . i have updated my post – Tje123 Jun 07 '17 at 06:25
  • I got some issue in windows. What I did was I first ran npm start first to start the packager and then I ran react-native run-android. – Ankit Aggarwal Jun 07 '17 at 06:34
  • https://stackoverflow.com/questions/43744156/error-calling-appregistry-runapplication-in-react-native#44035335 – Ankit Aggarwal Jun 07 '17 at 06:42

2 Answers2

0

There could be always something missing when you trying to use a library etc. My recommendation is npm uninstall realm and install again and check android directory if it is not realm linked decent, relink again manually or with following code react-native link realm.

edit for updated post: try adb reverse tcp:8081 tcp:8081 . If you have remotely debugging problem then try adb forward tcp:8082 tcp:8082

Barbaros
  • 86
  • 6
  • i have tried it.in my terminal showing `CANNOT TRANSLATE guest DNS ip `.also `WARNING: Requested adb port (8082) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details`.see update – Tje123 Jun 07 '17 at 06:46
  • i have solve this.solution is start in another port ` react-native start --port 9988` – Tje123 Jun 07 '17 at 10:11
0

It's better to create the react-native app with create-react-native-app and open created the folder in WebStorm rather than creating an app with WebStorm.

It may be caused by incompatibility of react-native version that is using in WebStorm and your Android Studio version. Also, I recommend using stable Node JS version.

create-react-native-app is the best way to create an app for today because it uses expo kit that provides you the wireless connection between your server and developing an app on your phone. It always uses the latest version of react and react-native that provides you stability versions and doesn't depend on WebStorm at all.

Follow this steps to create a new app with expo kit.

Ram Koti
  • 2,203
  • 7
  • 26
  • 36