1
resposta

erro com o comando react-native run-android

JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
> Configure project :app
Checking the license for package Android SDK Platform 26 in C:\Users\cenor\AppData\Local\Android\Sdk1\licenses\cenor\Desktop\React-Native\InstaluraMobile>
Warning: License for package Android SDK Platform 26 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Platform 26].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

* 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 1m 34s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

`

Quando eu uso o comando react-native run-android dá esse erro. O emulador android está em andamento durante o processo e isso aconteceu depois que fiz os ajustes para utilizar a lib react-native-navigation. Eu vi um fórum com o mesmo problema, segui os passos do professor porém mesmo assim não consegui!

1 resposta

Fala Miguel beleza ?

O erro está dizendo que não aceitamos as licenças do JDK ainda

Vamos até o bin

cd C:\Users\Admin\AppData\Local\Android\Sdk\tools\bin

dentro do bin vamos aceitar as licenças com esse comando:

sdkmanager --licenses

Depois tenta rodar novamente o comando do react-native

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