How can I fix this error in Android Studio: “Cause: invalid type code: 00”?

前端 未结 4 2094
旧巷少年郎
旧巷少年郎 2021-02-12 04:03

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

相关标签:
4条回答
  • 2021-02-12 04:50

    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

    0 讨论(0)
  • 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

    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
    

    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.

    0 讨论(0)
  • 2021-02-12 04:53

    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.

    0 讨论(0)
  • 2021-02-12 05:08

    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

    0 讨论(0)
提交回复
热议问题