Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Projeto não bilda

Estou na primeira aula e meu app não bilda, quando eu faço o comando react-native run-android tenho o seguinte erro: david@war-station:~/Projetos/ReactNative/projetos/Instalura$ react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 960 file(s) to forward-jetify. Using 12 workers... info Starting JS server... /bin/sh: 1: adb: not found 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 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 2s

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 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 2s

at makeError (/home/david/Projetos/ReactNative/projetos/Instalura/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/home/david/Projetos/ReactNative/projetos/Instalura/node_modules/execa/index.js:278:16)
at process._tickCallback (internal/process/next_tick.js:68:7)

david@war-station:~/Projetos/ReactNative/projetos/Instalura$

david@war-station:~/Projetos/ReactNative/projetos/Instalura$ react-native info info Fetching system and libraries information... System: OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa) CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 218.52 MB / 15.45 GB Shell: 5.0.16 - /bin/bash Binaries: Node: 10.19.0 - /usr/bin/node Yarn: Not Found npm: 6.4.1 - /snap/bin/npm Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Languages: Java: 11.0.7 - /usr/bin/javac Python: Not Found 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

1 resposta
solução!

Tive que fazer algumas configurações estou com o java 11 instalado tive que mudar o arquivo PATH e setar o java 8 e habilitar. primeiro executei

sudo update-alternatives --config java

copiei o retorno do java8

depois

sudo nano /etc/environment

coloquei uma nova linha

JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/"
source /etc/environment

Apaguei o projeto e recriei, deu certo