Skip to content Skip to sidebar Skip to footer

How Can I Fix This Error In Android Studio: "cause: Invalid Type Code: 00"?

All the code was working perfectly and nothing was wrong. Suddenly when i want to run the app it gives me this one error. I have not touched the code. I tried uninstalling Android

Solution 1:

Try disabling the "Only sync active variant" option and rebuilding. It worked for me.

enter image description here

EDIT:This address is for Android Studio with newer versions Setting > Experimental > Only sync the active variant

Solution 2:

I have solved this error.

Step 1. Remove .gradle file from the project.

Step 2. Remove .idea file from the project.

Step 3. Rebuild the project, that's all.

Happy Coding

Solution 3:

If you using Android Studio 4.0 or up and having Errors like below

    Cause: invalid type code: 17
    Cause: invalid type code: fe
    Cause: invalid type code: 13
Cause: invalid type code: 00

Or

Its says that something wrong with JDK then Follow below steps to resolve the error.

Step 1: First delete .gradle and .idea folder from project directory and restart Android Studio. Make sure it's gone from recycle bin.

Step 2: Go to Project Structure

Project Structure

Step 3: Select SDK Location from the left panel on Project Structure window.

Step 4: Go to JDK Location and click on down arrow then select the jre instead of jdk

C:\Program Files\Android\Android Studio\jre

JDK Location

And it will Solve the errors. Rebuild the project

Note: jre come with the android studio 4 installation not sure about the older version.

This solution work for me.

Solution 4:

This kind of error mostly happens for not using embedded JDK, I face this error in my Android studio 4.0.1 whenever I point my JDK location to "/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home"(This is my mac location for JDK, for window it might be different).

I follow the below steps to solve it.

  • Go to File -> Project Structure.

  • On the left side, click on SDK Location and go to JDK Location.

  • Change it to the Embedded JDK that comes with Android Studio.

  • Click on OK.

Solution 5:

If you have an OpenJDK > 8.0 installed, even if you point the Android Studio JDK to the embedded JDK you could still get Gradle build errors. For example, I had this error:

Cause: invalid type code: 0D

Even worse, I was unable to upgrade Android Studio with this internal IDE error. So I had to reinstall Android Studio from the web and then look into the issue.

The Android Studio LogCat showed a stack trace pointing to the internal JDK library files that was hard to diagnose (usually the libraries themselves are expected to compile out of the box). I am not a Java engineer but the errors looked like significant language changes.

Even after changing the IDE JDK to the embedded Android Studio JDK I was not able to fix the error, but I noticed that I had $JAVA_HOME defined. I also got the classic warning about using two different Java versions with Android Studio and Gradle separately. This helped me get closer to the root cause.

If you have multiple JDK versions installed, Gradle will use a different JDK at runtime if you have $JAVA_HOME set (for example with a conda JDK install). For gradle is a shell process after all, and uses those environment variables by default even if you define something in gradle.properties.

This was causing me headaches since the embedded Android Studio JDK was JDK 8, but turns out the Gradle JDK and the Android Studio JDK need to be in sync.

I resolved the issue by uninstalling the conda JDK 11/14 installs and sticking to JDK 8. I think any method to manage Java versions without $JAVA_HOME will work, and don’t recommend using jenv to manage Java versions since it uses this var (if you use multiple JDKs with some higher than 8). brew works on my mac, but could be harder to switch between versions seamlessly.

Post a Comment for "How Can I Fix This Error In Android Studio: "cause: Invalid Type Code: 00"?"