1. 程式人生 > >android studio Unable to load class 'org.codehaus.groovy.runtime.typehandling.ShortTypeHandling'

android studio Unable to load class 'org.codehaus.groovy.runtime.typehandling.ShortTypeHandling'

今天匯入之前的Android studio專案,出了一個很嚴重的Error,如下:

Error:Unable to load class 'org.codehaus.groovy.runtime.typehandling.ShortTypeHandling'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. <a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li></ul>In
the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
classpath 'com.android.tools.build:gradle:1.2.2'

2,找到gradle-wrapper.properties檔案,其中distributionUrl改成:

distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip

這樣就OK了。。。。