Error react-native run-android

1

I installed the react-native-cli , android sdk and the android emulator . I was able to do the init project but when I run the react-native run-android command it shows the log:

  

Scanning 577 folders for symlinks in D: \ dev \ git-repo \ courses \ reactNative \ InstaluraMobile \ node_modules (23ms) < >   JS server already running.
  Building and installing the app on the device (cd android & gradlew.bat installDebug) ...
  Error: Could not find or load parent 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 development environment:
link '

    
asked by anonymous 13.12.2017 / 15:06

1 answer

0

Before running the react-native run-android command, you need to have the Android emulator running with the 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 play (green) button to run the emulator with the desired AVD (choose one from the list, if you do not have one, create one)

Once you have the emulator already open and running the Android system, run the react-native run-android command to open the development server and connect to the emulator.

You have to run the command from the main project directory. That is, if you generated the project like this: react-native init MeuProjeto , do not forget to switch to the project directory before starting everything:

cd MeuProjeto
react-native run-android
    
14.12.2017 / 23:23