1
resposta

Erro ao executar npx react-native run-android

Minha aplicação retorna o seguinte erro: Insira aqui a descrição dessa imagem para ajudar na acessibilidade

O Erro completo é esse:

info JS server already running. '"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...

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings 5 actionable tasks: 5 up-to-date

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

    SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\Users\Lucas Mendes\Desktop\Alura2Native\SuperMarket2\android\local.properties'.

  • 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. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

    SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\Users\Lucas Mendes\Desktop\Alura2Native\SuperMarket2\android\local.properties'.

  • 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

at makeError (C:\Users\Lucas Mendes\Desktop\Alura2Native\SuperMarket2\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)    
at C:\Users\Lucas Mendes\Desktop\Alura2Native\SuperMarket2\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\Lucas Mendes\Desktop\Alura2Native\SuperMarket2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\Lucas Mendes\Desktop\Alura2Native\SuperMarket2\node_modules\@react-native-community\cli\build\index.js:142:9)

info Run CLI with --verbose flag for more details.

1 resposta

Fala, Lucas ! Tudo bem ?

Pelo que parece, você está tendo algum problema com as variáveis de ambiente da sua máquina, mas podem ser outros fatores isolados também, como versão do android ou as bibliotecas instaladas. Por isso, podemos seguir um passo a passo para tentar corrigir todos esses problemas de uma vez.

Tem um post aqui do fórum respondido pelo Instrutor André Cunha que é um problema idêntico a esse seu. Em que ele explica o passo a passo que é solicitado pela documentação para funcionar corretamente, voce vai encontrar nesse tópico aqui. Eu mesmo segui esse tutorial e funcionou por aqui, espero que funcione para você também.

Eu espero que tenha ajudado e qualquer coisa pode me chamar por aqui.

Abraço e bons estudos!