Gradle error: Write access is allowed from event dispatch thread only in Android Studio

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


Problem was occurred when android studio conflict with installed jdk version, Go to the (File -> Project Structure -> SDK Location), check 'Use embedded JDK' checkbox and set jdk location to 'path to android studio'\Android Studio\jre :) Simple