Android Studio unable to load class ' org.codehaus.groovy.runtime.typehandling.ShortTypeHandling '

Source: Internet
Author: User

Today, before importing the Android Studio project, there was a very serious error, as follows:

Error: unable toLoadclass ' org.codehaus.groovy.runtime.typehandling.ShortTypeHandling '.Possible causes forThis unexpectedErrorInclude:<ul><li>gradle' s dependency cache May is corrupt (this sometimes occurs after a network connection timeout.)<a href="Syncproject">re-download dependencies andSync project (requires network) </a></li><li>the State ofA Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons could solve this problem.<a href="Stopgradledaemons">StopGradle build processes (requires restart) </a></li></ul>inchThe Case  ofCorrupt Gradle processes, you can alsoTryClosing the IDE and  ThenKilling all Java processes.

Google searched for half a day and did not find the answer.
Analysis: Because gradle often updated, and often a variety of strange problems, so focus on the gradle problem, here http://stackoverflow.com/questions/28923716/ Getting-resolve-error-while-importing-project-in-android-studio-unable-to-load found the answer, my solution is as follows:
1, first the root directory of the Build.gradle file Classpath changed to:

‘com.android.tools.build:gradle:1.2.2‘

2. Locate the Gradle-wrapper.properties file, where Distributionurl is changed to:

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

This will be OK ....

Android Studio unable to load class ' org.codehaus.groovy.runtime.typehandling.ShortTypeHandling '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.