Run-android command

When launching an Android project using React-Native, it reports this error:

React-Native Command run-android unrecognized. Do you want to run this inside the reaction project?

+9
android react-native
source share
7 answers

You can try to do npm install before react-native run-android

+14
source share

First we need to install Reaction-native, and then update the packages, if you need, and start Android.

 npm install --save react-native@latest react-native upgrade react-native run-android 
+3
source share

The run-android command is recognized. Make sure you run npm install and are inside the reactive project.

I ran into this problem, the problem is that we need to go to the project folder.

example: I created a project in "MyApps" with the application name "DemoApp" on drive D

the root of the command line should be like this: D: \ MyApps \ DemoApp> act-native run-android

Now it will work without any problems.

The problem is that the information related to Android is present inside the application, and not in the main directory.

+1
source share

Many developers do not mention that some commands require a specific directory. In this case, in order to "respond to native run-android", you must be in the directory of your project!

+1
source share

I ran into the same problem and the above solutions did not work. Try using:

 yarn add react-native-cli 
0
source share

In my case, the problem was that I was in the android folder of my project because of this command cd android &&./gradlew assembleRelease that the solution was to go to cd../ and go to the project root directory and then execute this command

react-native run-android --variant=release

ran normally.

0
source share

First of all, please check if the devices / emulator are connected and if this command works.

 adb devices 

there should be several devices showing
it is better to restart / reconnect the emulator / device and then restart the application
if it doesn’t work, you can also try

 npm install 
0
source share

All Articles