Issue
I'm started to learn React Native, I'm using Linux (Distro Fedora 29), Java is already working and running, Android Studio has been instaled and configured (Following android studio documentation), my environment variables is exactly like:
export ANDROID_HOME=/home/ghost/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
When i run my project with "react-native run-android" i get the follow error:
[ghost@localhost mobile]$ 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
26 actionable tasks: 1 executed, 25 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.
Searching I find some tips, then I tried to restart the adb, like:
adb kill-server && adb start-server
Even if I do that, running adb devices
gives me nothing
[ghost@localhost mobile]$ adb devices
List of devices attached
Then i tried to run in android studio before (third image url), then it return me the logs:
16:56 Gradle sync started
16:56 Project setup started
16:56 Gradle sync finished in 3 s 620 ms (from cached state)
**16:56 Emulator: statvfs('/home/ghost/.android/avd/Pixel_2_API_28.avd/snapshots/default_boot/ram.img') failed: No such file or directory
16:56 Emulator: ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy
16:56 Emulator: qemu-system-x86_64: failed to initialize KVM: Device or resource busy
16:56 Emulator: Process finished with exit code 0**
**Images that can contain useful information
SDK Manager:
SDK Platforms that I have installed
SDK Tools that I have installed
AVD Manager:
Device
I have been trying to solve the problem for four days, reading the documentation itself, searching in forums, redoing the settings. But so far I have not been able to. thanks in advance
Solution
Thanks everyone for the answers, they made me very helpful! The problem that happened is because i was running vagrant at the same time i tried to start android emulator, i discovered that after running "vagrant halt" and trying to run android again, after running emulator became posssible run react-native project
Answered By - Nicolas Pedroso Lima
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.