2017-09-01 8 views
2

React Nativeが突然2014年代のMacBookで動作しない理由を理解しようとしています。それは8月に早く働いていた。コマンドラインからreact-native run-androidを実行しようとすると、次のエラーが表示されます。私がAndroid Studio 3.0でそれを開いたときにアプリが動作します。エラーはありません。私はこれを解決するために何を見ることができる任意のアイデア?私が行くと見つける最新のJDKを(9)と、それをインストールすることによって、文字通りReact-Native Setup Guide上の最新のJDKをインストールする「取ったとき不正アクセス対策の操作

Scanning 563 folders for symlinks in /Users/username/ReactNative/Wtf/node_modules (5ms) 
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/username/.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: 4.706 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 
+1

あなたはJDK 9を使用しているので、1つの出発点は、あなたがサポートするのGradleのバージョン使用していることを確認することですJDK 9.もう1つの所見は、「何が間違っていたか」がjava.xml.bind(JAXB)モジュールのクラスをリストしていることです。このモジュールはJDK 9ではデフォルトでは解決されないため、JAXBを依存関係として追加するか、一時的に '--add-modules java.xml.bind'を使用して回避する必要があります。 –

答えて

3

これは私に起こりました。 I uninstalled JDK 9をインストールし、React-Native Setup GuideにリンクされているJDK 8のバージョンをインストールしてください。

0

私はあなたがこの問題を解決するには、Java 9にspecify the JDK version

をすることができますインストールするときに、私は、この問題が発生しました。