简体   繁体   中英

How to run React Native project on Emulator in WebStorm

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.

在此处输入图片说明


Update

在此处输入图片说明

在此处输入图片说明

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM