omid
omid

Reputation: 150

Gradle Sync Failed in Android Studio 3.6 Cause invalid type code :85

I just update my Android Studio from version 3.5.3 to 3.6, now I open any project I see this error and gradle doesn't sync

enter image description here

Upvotes: 14

Views: 18971

Answers (3)

I found out that some people might use Android 4.0 with Java 14 and Gradle 6.1.1 like me. And they are not supported for each other, so just update Gradle to 6.5.1; it will solve the problem. To update Gradle, click in the Android Studio tab: File -> Project Structure -> Project. Then, change the Gradle version to 6.5.1.

all_java_gradle_verion

Thanks, it was very helpfull!

Upvotes: 3

Siddharth Venu
Siddharth Venu

Reputation: 1388

Here's what I did to solve the issue with JDK 11 + Android 4.0.

  1. Follow Tran's answer (https://stackoverflow.com/a/62967378/5359328) and upgrade to Gradle 6.5.1.
  2. Build project. It still shows the same error.
  3. Change JDK to 8 in Project Structure, build. It's successful.
  4. Change JDK back to 11 in Project Structure, build. It's successful again.

Upvotes: 1

Glenn Sandoval
Glenn Sandoval

Reputation: 3745

I was having the same issue. I solved it by changing the JDK version I was using which was JDK 13.

  1. Go to File -> Project Structure.
  2. On the left side, click on SDK Location and go to JDK Location.
  3. Change it to the Embedded JDK that comes with Android Studio.
  4. Click on OK.

Upvotes: 39

Related Questions