简体   繁体   中英

How to fix error saying “Task :app:installDebug FAILED”, while run my react native project in android studio?

I have went through environment setup process same as the react-native doc Linux -> Android..

When I run "react-native run-android", I got the error saying

Task :app:installDebug FAILED FAILURE: Build failed with an exception.

Can anyone please help me to sort out this?

This is the error..

azran@Azran:~/Desktop/AwesomeProject2$ react-native run-android
info JS server already running.
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...
> Task :app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
26 actionable tasks: 25 executed, 1 up-to-date
error 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:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.

com.android.builder.testing.api.DeviceException: No connected devices!

This error clearly indicates that no device was found for the app to run. Make sure your emulator was running and if using physical device make sure that developer mode and USB debugging was ON on the device.

More info at https://developer.android.com/training/basics/firstapp/running-app

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