react-native: FAILURE: Build failed with an exception.
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:/home/marcus/.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: 3.881 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
Follow step by step tutorial react native
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 23 (1 by maintainers)
Switching from JDK9 to JDK8 (Windows 10 x64, gradle 2.14.1 ) solved the issue for me.
I also had two JDK versions installed (8 & 9), I removed 9 and everything started working.
To uninstall: Navigate to /Library/Java/JavaVirtualMachines and remove the v9 directory
cd /Library/Java/JavaVirtualMachinessudo rm -rf {yourVersionName}.jdkIf you do not have version 8 in that directory you will need to install JDK8.
https://facebook.github.io/react-native/docs/getting-started.html says “Download and install JDK 8 or newer”. It should probably be explicit that only “JDK 8” will work.
After deleted jdk-9 will be ok, but why RN can’t support jdk-9?
Hey, thanks for reporting this issue!
It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.
I am going to close this, but feel free to open a new issue with the additional information provided. Thanks!
Facing same issue with JDK 10. Please add support for JDK 10 and update the doc too.
+1 for removing JDK9
Thanks @orinmurphy @azamatsmith, its JDK9 which is causing the issue, Now its working fine after installing JDK8.
@hramos im having the exact same issue as @MarcusMann.
1: react-native init ReactNativeProject 2: cd /ReactNativeProject 3: npm install 4: react-native run-android
Same issue. JDK 10.
@bjornua yeah, surprised this hasn’t been changed, this issue has been around for a while…
yeah, some technical writer got into wishful thinking
No need to remove JDK9, just update your JAVA_HOME and PATH variable to point to JDK8. Also, in the path variable, make sure jdk8 path has higher priority than javaclasspath ( added by oracle when you first install JAVA, this will still point to your earlier install version i.e; jdk9 ).
To switch between versions, just change the priority order in Path environment variable.
Removing jdk9 is the solution for me
@vbarinov Solution fixed my issue, now is working perfectly… 👍