Olá, estou com dificuldade de conseguir rodar o projeto no android.
Segui direitinho o passo a passo para preparar o ambiente no macOS para desenvolvimento Android com React Native - node v6.10.3 - watchman v4.9.0 - react-native-cli v2.0.1 - JDK 9
Android Studio - Android SDK - Android SDK Platform - Performance (Intel ® HAXM) - Android Virtual Device
SDK Plataforms - Google APIs - Android SDK Platform 23 - Intel x86 Atom_64 System Image - Google APIs Intel x86 Atom_64 System Image
SDK Tools 23.0.1
Configuração do .bash_profile ok.
Criei o Virtual Device Nexus 5x "Marshmallow API Level 23, x86_64 ABI image" com "Android 6.0 (Google APIs)".
Criei meu projeto com o react-native init example
Entrei na pasta e rodei react-native start
Porém quando rodo react-native run-android
recebo o seguinte erro:
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file: [...]/.gradle/wrapper/dists/gradle-2.14.1-all/8bnwg5hd3w55iofp58khbp6yv/gradle-2.14.1/lib/gradle-base-services-2.14.1.jar) to method java.lang.ClassLoader.getPackages()
WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> javax/xml/bind/annotation/XmlSchema
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 9.607 secs
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/android-setup.html
Recebo este erro mesmo executando a observação de iniciar manualmente o Virtual Device antes de rodar run-android
(Faço isso abrindo o meu projeto "example" no Virtual Studio e clico no ícone do AVD Manager - o simulador roda o android ok mas não abre o projeto sozinho)
- Tem como executar o simulador pelo AVD Manager sem precisar abrir o android studio? (instalei o npm react-native-run-android que posso abrir o simulador direto pelo terminal, porém recebo o mesmo erro descrito à cima)
- O que estou fazendo de errado? T-T
OBS. O comando run-ios
funciona perfeitamente ...