10

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

agm1984
  • 15,500
  • 6
  • 89
  • 113
Enkum
  • 635
  • 8
  • 22

3 Answers3

8

If anyone else having the same problem with the above fix not working - then try installing JDK 1.8 instead of JDK 1.9 and set the JAVA_HOME environment variables. This fixed it for me.

Isidor Nygren
  • 89
  • 1
  • 2
3

WINDOWS INSTRUCTIONS: To update your JAVA_HOME Environment Variable:

  1. press the Windows Key on your keyboard,
  2. type "view advanced",
  3. click on View Advanced System Settings,
  4. click Environment Variables,
  5. select JAVA_HOME,
  6. click Edit,
  7. click Browse Directory,
  8. click This PC,
  9. click C:\,
  10. click Program Files,
  11. click Java,
  12. finally, select jdk1.8.0_### (actual build # may vary)

missing JDK 1.8.0? - Google "download Java JDK" and download it from oracle.com

Cleanup Phase: Press OK, OK, OK, OK

RESTART THE COMMAND PROMPT (if you encounter any issue now, try running Command Prompt as Administrator => right click, run as admin)

Now, try again (in the correct folder):

react-native run-android
agm1984
  • 15,500
  • 6
  • 89
  • 113
  • This actually don't work because, I do have the path set to the JDK. In my case it is C:\Program Files\Java\jdk-10.0.2. I have done a little research and it seems that most people are down grading to JDK8 to get it working. Just thought Id throw that out there. – James Leshko Aug 03 '18 at 05:19
  • Get JDK8 Here-->[link](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) – James Leshko Aug 03 '18 at 05:49
0

FIX:

  1. Make sure that java is installed on your system. Or install using linux command:

    $sudo apt-get install openjdk-8-jdk

  2. Set JAVA_HOME environment variable. For linux

    JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"

    to /etc/environment file new line.

  3. Make sure Android/Sdk is included in your home directory.(i.e. Assuming you have installed android-studio).
  4. Export ANDROID_HOME in ~/.bashrc file.

    export ANDROID_HOME="$HOME/Android/Sdk" export PATH="$PATH:$ANDROID_HOME/tools" export PATH="$PATH:$ANDROID_HOME/platform-tools" source /etc/environment

Last tip: if you get watchman error everytime you close(ctrl+c) and open the JS server. run the following command.

echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server

Enkum
  • 635
  • 8
  • 22