1

I am creating react native android application in my MacBook for the first time. After completing all installation process I am getting this error message in my terminal.

Manans-MacBook-Air:MyNewProject mananpatel$ react-native run-android
Scanning 577 folders for symlinks in /Applications/xxxxx/xxxxx/xxxxx/MyNewProject/node_modules (10ms)
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:/Users/mananpatel/.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: 10.926 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

I am searching solution for last 3 hours but not able to find what is missing so if know please guide me to run the application successfully.

Mr.Happy
  • 517
  • 1
  • 9
  • 25
  • Possible duplicate of [Illegal reflective access operation](https://stackoverflow.com/questions/46006686/illegal-reflective-access-operation) – taniard Feb 11 '18 at 14:58

3 Answers3

1

You need to downgrade to 1.8 as stated in the other answers.

If you need to downgrade You can follow this answer here As verified by this issue comment

0

respectively:

$ export ANDROID_HOME=$HOME/Library/Android/sdk
$ export PATH=$PATH:$ANDROID_HOME/tools
$ export PATH=$PATH:$ANDROID_HOME/platform-tools

$ cd app
$ npm i
$ cd android
$ ./gradlew clean
$ cd ..
$ react-natibe run-android

the first 3 lines: add path. other lines. Run operations

Batu
  • 304
  • 2
  • 12
  • 1
    Welcome to SO. Please add some context/explanation, as code only answers do not fulfill our standards. See [how to answer](http://stackoverflow.com/help/how-to-answer). – Zulan Sep 26 '17 at 11:23
  • After executing ./gradlew clean command in terminal, I am still getting ```A problem occurred configuring project ':app'. > Failed to notify project evaluation listener. > javax/xml/bind/annotation/XmlSchema``` this error. – Mr.Happy Sep 26 '17 at 16:16
0

Which Java SDK version do you have installed? If it's 1.9, try uninstalling it and install JDK 1.8.

Christian Vorhemus
  • 2,396
  • 1
  • 17
  • 29