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

Erro ao rodar npx run android

Pessoal Bom dia, alguém tem ideia do que pode ser? Fiz alguns passo a passos e nada resolveu (Exclui o node_modules) e etc....

PS C:\projeto\myskills> yarn run android yarn run v1.22.15 $ react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 936 file(s) to forward-jetify. Using 8 workers... info JS server already running. O sistema n�o pode encontrar o caminho especificado. 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...

Configure project :app Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated. Checking the license for package Android SDK Platform-Tools in C:\Android\Sdk\licenses Warning: License for package Android SDK Platform-Tools not accepted. Checking the license for package SDK Patch Applier v4 in C:\Android\Sdk\licenses Warning: License for package SDK Patch Applier v4 not accepted. Checking the license for package Android Emulator in C:\Android\Sdk\licenses Warning: License for package Android Emulator not accepted. Checking the license for package Android SDK Tools in C:\Android\Sdk\licenses Warning: License for package Android SDK Tools not accepted. Checking the license for package Android SDK Build-Tools 30.0.2 in C:\Android\Sdk\licenses Warning: License for package Android SDK Build-Tools 30.0.2 not accepted. Checking the license for package Android SDK Platform 31 in C:\Android\Sdk\licenses Warning: License for package Android SDK Platform 31 not accepted. 6 actionable tasks: 6 up-to-date

FAILURE: Build failed with an exception.

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

    Failed to install the following Android SDK packages as some licences have not been accepted. patcher;v4 SDK Patch Applier v4 emulator Android Emulator platforms;android-31 Android SDK Platform 31 platform-tools Android SDK Platform-Tools build-tools;30.0.2 Android SDK Build-Tools 30.0.2 tools Android SDK Tools To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager. Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

    Using Android SDK: C:\Android\Sdk

  • 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 4s

error Failed to install the app. Please accept all necessary Android SDK licenses using Android SDK Manager: "$ANDROID_HOME/tools/bin/sdkmanager --licenses". 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'.

    Failed to install the following Android SDK packages as some licences have not been accepted. patcher;v4 SDK Patch Applier v4 emulator Android Emulator platforms;android-31 Android SDK Platform 31 platform-tools Android SDK Platform-Tools build-tools;30.0.2 Android SDK Build-Tools 30.0.2 tools Android SDK Tools To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager. Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

    Using Android SDK: C:\Android\Sdk

  • 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 4s

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

info Run CLI with --verbose flag for more details.error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. PS C:\projeto\myskills>

2 respostas
solução!

Olá, Marcio! Bom dia!

Parece que você está enfrentando alguns problemas ao rodar o comando "npx run android" no seu projeto. O erro menciona que algumas licenças do Android SDK não foram aceitas e que é necessário aceitar essas licenças e instalar os componentes ausentes usando o Android Studio SDK Manager.

Uma possível solução para esse problema é abrir o Android Studio e ir para o SDK Manager. Lá, você deve aceitar as licenças pendentes e instalar os componentes necessários, como o SDK Platform-Tools, o SDK Build-Tools e o Android Emulator. Após fazer isso, tente executar novamente o comando "npx run android" e veja se o problema persiste.

Caso ainda esteja enfrentando dificuldades, sugiro verificar se o caminho para o Android SDK está corretamente configurado nas variáveis de ambiente do seu sistema operacional. Certifique-se de que o caminho está apontando para a pasta correta onde o Android SDK está instalado.

Espero que essas dicas possam te ajudar a resolver o problema. Se ainda tiver alguma dúvida, fique à vontade para perguntar. Estou aqui para ajudar!

Espero ter ajudado e bons estudos!

Obrigado