admin管理员组

文章数量:1426913

I'm trying to run my react native app in emulator by using command react-native run-android but it's throwing that error

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See .3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 44s
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync /Opt/Android/platform-tools/adb ENOENT
info Starting the app...
The system cannot find the path specified.
error Failed to start the app. Run CLI with --verbose flag for more details.
Error: Command failed: /Opt/Android/platform-tools/adb shell am start -n com.reactproject/com.reactproject.MainActivity
    at makeError (C:\Users\Danger World\ReactProject\node_modules\execa\index.js:174:9)

I already setup my android studio and sdk manager, avd manager like it's shown in doc also I already set path but it's still showing that error, anyone know why? Can anyone help please?

I'm trying to run my react native app in emulator by using command react-native run-android but it's throwing that error

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 44s
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync /Opt/Android/platform-tools/adb ENOENT
info Starting the app...
The system cannot find the path specified.
error Failed to start the app. Run CLI with --verbose flag for more details.
Error: Command failed: /Opt/Android/platform-tools/adb shell am start -n com.reactproject/com.reactproject.MainActivity
    at makeError (C:\Users\Danger World\ReactProject\node_modules\execa\index.js:174:9)

I already setup my android studio and sdk manager, avd manager like it's shown in doc also I already set path but it's still showing that error, anyone know why? Can anyone help please?

Share Improve this question asked Oct 21, 2020 at 8:07 Kanwarjeet SinghKanwarjeet Singh 7452 gold badges14 silver badges40 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 31

You can fix it by using the command :

react-native doctor

This command shows all issues that need to be fixed.

Press f to fix the issues and don't forget to restart your windows

And after then open the emulator before running your project. Once emulator opened, run command: react-native run-android

After fixed:

Don't forget to give me an upvote if that's work.

In My Case, I have to re-run the command in the same terminal where you are trying to run npx react-native run-android

Step 1. paste the source command first

source ~/.bash_profile OR source ~/.bashrc

Step 2. RUN Next command

npx react-native run-android

set your AVD manager path and JDK path like this , also you have to add Android Home path

本文标签: