Error React-Native run-android

Asked

Viewed 8,201 times

1

I installed the React-Native-cli, android sdk and the emulator of android. I managed to do the init but when I run the command React-Native run-android it shows the log:

Scanning 577 folders for symlinks in D: dev git-Repo courses reactNative Installuramobile node_modules (23ms)<> JS server already running.
Building and Installing the app on the device (cd android && gradlew.bat installDebug)...
Error: Unable to locate or load main class org.gradle.wrapper.Gradlewrappermain
Could not install the app on the device, read the error above for Details.
Make sure you have an Android Emulator running or a device Connected and have set up your Android:
https://facebook.github.io/react-native/docs/android-setup.html`

1 answer

2

Before turning the remote react-native run-android, you need to have the Android emulator running with AVD (Android Video Device).

One of the ways to run the emulator is to open the project in Android Studio and:

(1) by clicking Tools -> Android -> AVD Manager
(Tools -> Android -> AVD Manager)

(2) Click the (green) play button to run the emulator with the desired AVD (choose one from the list; if you have none, create a)

After having the emulator already opened and running the Android system, run the command react-native run-android to open the development server and connect to the emulator.


You have to run the project’s main directory command. That is, if Voce generated the project like this: react-native init MeuProjeto, don’t forget to switch to the project directory before starting everything:

cd MeuProjeto
react-native run-android

Browser other questions tagged

You are not signed in. Login or sign up in order to post.