Create-react-native-app: Failed to notify project evaluation listener

Created on 15 Nov 2017  路  11Comments  路  Source: expo/create-react-native-app

Description

I trying to first run an react-native app with react-native run-android.

Expected Behavior

I expect it to work, like it does when I call react-native run-ios

Observed Behavior

react-native run-android
Scanning folders for symlinks in /Users/tiagogouvea/www/go-along/mobile/node_modules (12ms)
JS server already running.
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/tiagogouvea/.gradle/wrapper/dists/gradle-4.0-milestone-1-all/2rnr7rhi2zsmkxo9re7615fy6/gradle-4.0-milestone-1/lib/gradle-base-services-4.0.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
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Users/tiagogouvea/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.


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 in 4s
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

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: empty
  • npm ls react-native: [email protected]
  • npm ls expo: empty
  • node -v: v8.0.0
  • npm -v: 5.5.1
  • yarn --version: 1.2.1
  • watchman version: 4.9.0
  1. Operating system: macOs 10.12.6
  2. Phone/emulator/simulator & version: Genymotion image

Reproducible Demo

To validate it I started a clean project with react-native init goalong and try to run it with react-native run-android.

Most helpful comment

Why JDK v9 doesn't work? Java 10 is ahead of us, shouldn't we use the newest possible version all the time and this ticket should be closed when it's done?

All 11 comments

EDIT: it's likely the JDK version you have (java -version)
You need to use JDK 8, v9 does NOT work

how can i move from JDK v9 to v8

Hi! It looks like this is an issue with a "plain" React Native repository, and such issues belong on https://github.com/facebook/react-native. Thanks!

Why JDK v9 doesn't work? Java 10 is ahead of us, shouldn't we use the newest possible version all the time and this ticket should be closed when it's done?

Doesn't work with 10 either.

Confirmed it still doesn't work either with 9 or 10. This is not good at all! In other projects I'm using Java 10 features extensively so I can't just uninstall 10 and reinstall 8 >:(
Please add Java 10 support

It is still not working but I guess
Code below should work

brew cask uninstall java
brew tap caskroom/versions
brew cask install java8

Bump

second bump, wish it worked with newer Java versions

In fact I was running Java 9:

$/ java --version
java 9
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

I removed Java 9 and installed back Java 8. For who want to do it: how to remove Java in mac and download Java 8. After that I added JAVA_HOME to my bashfile how to.

And, everything wokrs fine now. Thanks for help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

witbybit picture witbybit  路  4Comments

liyanxi picture liyanxi  路  3Comments

iRoachie picture iRoachie  路  5Comments

anp picture anp  路  3Comments

andyvanosdale picture andyvanosdale  路  3Comments