Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

Problema ao executar "npx react-native run-android"

Não estou conseguindo rodar o comando de npx react-native run-android. Já instalei e desinstalei de todas as formas. Já pesquisei na internet outras fonte e nada. Agora estou completamente no escuro. Se puder ajudar agradeceria.

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 4 workers...
info Starting JS server...
'adb' n�o � reconhecido como um comando interno
ou externo, um programa oper�vel ou um arquivo em lotes.
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

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.0.1/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installDebug' not found in project ':app'.

* Try:
Run gradlew tasks to get a list of available tasks. 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 16s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installDebug' not found in project ':app'.

* Try:
Run gradlew tasks to get a list of available tasks. 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 16s

    at makeError (D:\Node Js - Projetos\SelfMadeFinanceiro-FrontEnd\SelfMadeFinanceiroFront\node_modules\execa\index.js:174:9)
    at D:\Node Js - Projetos\SelfMadeFinanceiro-FrontEnd\SelfMadeFinanceiroFront\node_modules\execa\index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async runOnAllDevices (D:\Node Js - Projetos\SelfMadeFinanceiro-FrontEnd\SelfMadeFinanceiroFront\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
    at async Command.handleAction (D:\Node Js - Projetos\SelfMadeFinanceiro-FrontEnd\SelfMadeFinanceiroFront\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
4 respostas

Oi Danilo, tudo bom?

Parece que durante a instalação do android ele não configurou o path do "adb" no seu sistema. Vc já tentou configurar manualmente?

https://www.windowsclub.com.br/tutorial-instalacao-do-android-debug-bridge-adb/

Olá Ricardo, tudo bom?

Acabei de fazer a instalação manualmente. Tentei fazer o 'run-android' e continua o mesmo problema.

Uma coisa curiosa que percebi foi que quando eu executo o "npx react-native info" as informações sobre o Android Studio e o SDK aparecem como não encontrados. No entanto, todos estão instalados em minha maquina. Achei um pouco estranho, será que tem relação?

Veja abaixo:

PS D:\Node Js - Projetos\SelfMadeFinanceiro-FrontEnd\SelfMadeFinanceiroFront> npx react-native info       
info Fetching system and libraries information...
System:
    OS: Windows 10 10.0.18363
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
    Memory: 5.85 GB / 15.90 GB
  Binaries:
    Node: 13.13.0 - D:\Arquivos Programas\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.14.4 - D:\Arquivos Programas\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 1.8.0_211 - C:\Program Files\Java\jdk1.8.0_211\bin\javac.EXE
    Python: 2.7.17 - D:\Python 2.7\python.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0
    react-native: 0.62.2 => 0.62.2
  npmGlobalPackages:
    *react-native*: Not Found
PS D:\Node Js - Projetos\SelfMadeFinanceiro-FrontEnd\SelfMadeFinanceiroFront> 

Parece que as variáveis de ambiente deles tbm não foram configuradas. Pro SDK vc precisa ter a variável ANDROID_SDK_ROOT Configurada no PATH tbm.

No meu caso não tenho o Android Studio configurado tbm.

solução!

Olá Ricardo,

Agora consegui. Eu desinstalei tudo e configurei tudo novamente. Obrigado pelo apoio até este momento. Vamos para as próximas fases agora. Forte abraço.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software