本文介绍了Gradle错误:只能在android studio中从事件分派线程写入访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将Android Studio更新到版本2.2(在Windows 10上)之后,第二天早上,当我在任何项目上建立gradle时,我收到了这样的错误:

After updating Android Studio to version 2.2 (on Windows 10) and somehow next morning i received such error when gradle built on any project:

Write access is allowed from event dispatch thread only

尽管gradlew -build命令起作用,成功完成。
我尝试了WTF修复工具的典型Android开发工具:清理构建,无效缓存,删除构建文件夹,删除.gradle文件夹,尝试了不同的gradle设置,甚至重新安装android studio并且没有任何帮助。


我创建这个问题只是为了与我的社区分享我的经验,因为我浪费了两个小时。

Despite that gradlew -build command worked and completed successfully.I tried typical android dev's of WTF repairing set: clean build, invalidate caches, removing build folders, removing .gradle folder, tried different gradle settings, even reinstalling android studio and nothing helped.

I've created this question only to share my experience with community, because i wasted two hours on it.

推荐答案

所以这个问题的结论是android studio与我安装的jdk版本冲突,所以当我检查jdk位置(文件 - >项目结构 - > SDK位置),勾选'使用嵌入式JDK'复选框并将jdk位置设置为'android studio'\Android Studio \jre

So the problem was concluded in that android studio conflicted with my installed jdk version, so it was resolved when i checked jdk location (File -> Project Structure -> SDK Location), ticked 'Use embedded JDK' checkbox and set jdk location to 'path to android studio'\Android Studio\jre

这篇关于Gradle错误:只能在android studio中从事件分派线程写入访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 13:56