2017-04-05 14 views

答えて

89

を持って、私はそれが既知のバグだと判明幸いにも、解決策は非常に簡単です。

release notesから:

After updating the Android plugin version, you need to stop the Gradle daemon to apply the update (Issue 267099). Otherwise, Gradle sync and builds fail with the following error:

Could not initialize class com.android.ide.common.util.ReadWriteProcessLock, Failed to notify build listener or java.lang.ExceptionInInitializerError.

To stop the daemon, you can either:

1- restart Android Studio,

or

2- enter the following command in the IDE's Terminal window: ./gradlew --stop or for windows gradlew --stop

Gradle restarts the daemon for you the next time you sync or build your project.

18

最良の方法は無効化/キャッシュの再起動またはオープン端子であり、この問題はバージョン2.4で発生さ

gradlew --stop 
+0

おかげで動作するかどうかを教えてください。 –

+0

私のために働いた。 Android 2.4プレビュー4 –

4

窓について

./gradlew --stop 

を入力4以上でこの問題を解決するには、Gradleデーモンを停止してアップデート(問題267099)。そうしないと、Gradleの同期とビルドが失敗し、次のエラーが発生します。クラスcom.android.ide.common.util.ReadWriteProcessLockを初期化できませんでした。ビルドリスナーに通知できませんでした。またはjava.lang.ExceptionInInitializerError。 デーモンを停止するには、Androidスタジオを再起動するか、IDEのターミナルウィンドウで次のコマンドを入力します。./gradlew --stop。 次回にプロジェクトを同期またはビルドするときに、Gradleがデーモンを再起動します。詳細については

/ソース - https://androidstudio.googleblog.com/2017/04/android-studio-24-preview-4-is-now.html

3

もう一つの便利な方法:

Android Studio -> File -> Invalidate Caches/Restart... -> Invalidate and Restart

関連する問題