Error: Gradle sync failed: Cause: invalid type code: 85 support [Android Studio]

Overview

――When I started Android Studio for the first time in 2 to 3 months, all the projects including existing and new ones stopped working.

--In conclusion, when I changed the JDK to the one built in Android Studio, the error disappeared and it started to work.

--The error code displayed in the event log is as follows.

Gradle sync failed: Cause: invalid type code: 85



## Citation information
 We responded by referring to the contents of the following site.
[Gradle Sync Failed in Android Studio 3.6 Cause invalid type code :85](https://translate.googleusercontent.com/translate_c?depth=1&hl=ja&prev=search&rurl=translate.google.com&sl=en&sp=nmt4&u=https://stackoverflow.com/questions/60435743/gradle-sync-failed-in-android-studio-3-6-cause-invalid-type-code-85&usg=ALkJrhixS5JabpGvDv5b5fl0iFb89OQtWw)

 Since I just googled with the error code, there may be more detailed information, but I was able to respond so I will not investigate deeply
## Correspondence contents
 Not only a specific project but all projects stopped working uniformly, so I think it is not an individual error but an environmental problem.
 When I checked the event log, it seemed that gradle startup (?) Failed, so I felt like "Is it gradle again!".

 For the time being, when I searched with the following error, a site that seemed to be at the top came out, but since it was an English question site, I will leave it here in Japanese including a memorandum.

#### **`Gradle sync failed: Cause: invalid type code: 85`**

As a result of machine translation of the above site, it seems that the problem is occurring when upgrading from Android Studio 3.5 to Android Studio 3.6. As a countermeasure, it is recommended to change the JDK location of the project to the one built in Android Studio instead of the external one.

The procedure was as follows.

  1. Select "Project Structure" from the "File" menu at the top.
無題3.png 2. The project structure screen will be displayed. Select "SDK Location" from the list on the left. 3. Select "Embedded JDK: ~" from "JDK Location" in the center. Click "Apply" or "OK" to close. 4. You will be asked to upgrade gradle, so select upgrade or installation.

The project worked fine when I proceeded to this point. In short, it seems that updating gradle has failed, but I was not sure about the details.

By the way, even if I restored the JDK location after the error was fixed, it worked fine, so it was probably due to the failure to update gradle. (I used to use OpenJDK, but it worked fine when I returned it.)

Postscript

Also, gradle! I only get the impression. Also, as is often said, we have to leave a commandment that Android Studio h is not a blind update. (I'm not saying I won't always update)

This time it's a problem specific to upgrading from 3.5 to 3.6, so I don't think it will happen frequently. Hopefully this article will be unnecessary

Recommended Posts

Error: Gradle sync failed: Cause: invalid type code: 85 support [Android Studio]
Commit failed exit code 1 error resolution