Boa tarde,
Quando rodo o comando "npx react-native run-android" ele chega a abrir o emulador mas não instala o app (projeto), a mensagem é:
PS C:\Users\hitom> npx react-native run-android
error Unrecognized command "run-android".
info Run "react-native --help" to see a list of all available commands.
PS C:\Users\hitom> cd teste
PS C:\Users\hitom\teste> npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Task :app:compileDebugJavaWithJavac FAILED
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.2/userguide/command_line_interface.html#sec:command_line_warnings
11 actionable tasks: 2 executed, 9 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that C:\Program Files (x86)\Java\jre1.8.0_261 contains a valid JDK installation.
* 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 5s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
E quando escrevo "npx react-native info" aparece:
PS C:\Users\hitom\teste> npx react-native info
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.19041
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Memory: 1.03 GB / 7.90 GB
Binaries:
Node: 12.18.2 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.1
System Images: android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6626763
Languages:
Java: 11.0.8 - C:\Program Files\AdoptOpenJDK\jdk-11.0.8.10-hotspot\bin\javac.EXE
Python: 2.7.2 - C:\Python27\python.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
npmGlobalPackages:
*react-native*: Not Found
Gostaria de ajuda, agradeço desde já.