Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cause: invalid type code: 1C for android studio gradle

My Android studio working fine but after update the plugin I am getting below error. I tried updating the JDK and reinstall the Android Studio but still facing the same error.

This is sync tab error.

Cause: invalid type code: 1C

This is the build tab error

   020-06-04 19:13:09,207 [1650474]  ERROR - nsions.impl.ExtensionPointImpl - Android Studio 4.0  Build #AI-193.6911.18.40.6514223 
2020-06-04 19:13:09,207 [1650474]  ERROR - nsions.impl.ExtensionPointImpl - JDK: 1.8.0_242-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2020-06-04 19:13:09,207 [1650474]  ERROR - nsions.impl.ExtensionPointImpl - OS: Windows 10 
2020-06-04 19:13:09,207 [1650474]  ERROR - nsions.impl.ExtensionPointImpl - Plugin to blame: CSV Plugin version: 2.11.1 
2020-06-04 19:13:09,208 [1650475]  ERROR - nsions.impl.ExtensionPointImpl - While loading class net.seesharpsoft.intellij.plugins.csv.CsvFileTypeOverrider: net/seesharpsoft/intellij/plugins/csv/CsvFileTypeOverrider has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: net.seesharpsoft.intellij.plugins.csv] 
com.intellij.diagnostic.PluginException: While loading class net.seesharpsoft.intellij.plugins.csv.CsvFileTypeOverrider: net/seesharpsoft/intellij/plugins/csv/CsvFileTypeOverrider has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: net.seesharpsoft.intellij.plugins.csv]
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:223)
    at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:167)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getImplementationClass(ExtensionComponentAdapter.java:80)
    at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.createInstance(ExtensionComponentAdapter.java:39)
    at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.java:63)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:442)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:429)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.access$100(ExtensionPointImpl.java:33)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl$1.next(ExtensionPointImpl.java:337)
    at com.intellij.openapi.extensions.impl.ExtensionProcessingHelper.computeSafeIfAny(ExtensionProcessingHelper.java:39)
    at com.intellij.openapi.extensions.ExtensionPointName.computeSafeIfAny(ExtensionPointName.java:60)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.getFileTypeByFile(FileTypeManagerImpl.java:742)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.getFileTypeByFile(FileTypeManagerImpl.java:736)
    at com.intellij.openapi.vfs.VirtualFile.getFileType(VirtualFile.java:328)
    at com.intellij.psi.SingleRootFileViewProvider.<init>(SingleRootFileViewProvider.java:59)
    at com.intellij.psi.impl.PsiFileFactoryImpl.trySetupPsiForFile(PsiFileFactoryImpl.java:111)
    at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:95)
    at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:48)
    at org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementFactoryImpl.createDummyFile(GroovyPsiElementFactoryImpl.java:375)
    at org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementFactoryImpl.createGroovyFile(GroovyPsiElementFactoryImpl.java:621)
    at org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementFactoryImpl.createExpressionFromText(GroovyPsiElementFactoryImpl.java:169)
    at org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory.createExpressionFromText(GroovyPsiElementFactory.java:146)
    at com.android.tools.idea.gradle.dsl.parser.groovy.GroovyDslUtil.createLiteral(GroovyDslUtil.java:375)
    at com.android.tools.idea.gradle.dsl.parser.groovy.GroovyDslParser.convertToPsiElement(GroovyDslParser.java:147)
    at com.android.tools.idea.gradle.dsl.parser.elements.FakeElement.lambda$createPsiElement$0(FakeElement.java:66)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:807)
    at com.android.tools.idea.gradle.dsl.parser.elements.FakeElement.createPsiElement(FakeElement.java:66)
    at com.android.tools.idea.gradle.dsl.parser.elements.FakeElement.produceValue(FakeElement.java:118)
    at com.android.tools.idea.gradle.dsl.model.CachedValue.updateValue(CachedValue.java:68)
    at com.android.tools.idea.gradle.dsl.model.CachedValue.getValue(CachedValue.java:53)
    at com.android.tools.idea.gradle.dsl.parser.elements.GradleDslSimpleExpression.getValue(GradleDslSimpleExpression.java:119)
    at com.android.tools.idea.gradle.dsl.model.ext.GradlePropertyModelImpl.extractAndGetValueType(GradlePropertyModelImpl.java:523)
    at com.android.tools.idea.gradle.dsl.model.ext.GradlePropertyModelImpl.getValueType(GradlePropertyModelImpl.java:108)
    at com.android.tools.idea.gradle.dsl.model.ext.PropertyUtil.resolveModel(PropertyUtil.java:130)
    at com.android.tools.idea.gradle.dsl.model.ext.ResolvedPropertyModelImpl.resolveModel(ResolvedPropertyModelImpl.java:245)
    at com.android.tools.idea.gradle.dsl.model.ext.ResolvedPropertyModelImpl.toString(ResolvedPropertyModelImpl.java:168)
    at com.android.tools.idea.gradle.structure.model.android.PsDeclaredLibraryAndroidDependency.getSpec(PsLibraryAndroidDependency.kt:51)
    at com.android.tools.idea.gradle.structure.model.PsDeclaredLibraryDependency$DefaultImpls.toKey(PsLibraryDependency.kt:36)
    at com.android.tools.idea.gradle.structure.model.android.PsDeclaredLibraryAndroidDependency.toKey(PsLibraryAndroidDependency.kt:43)
    at com.android.tools.idea.gradle.structure.model.PsDeclaredDependencyCollection.refreshParsedDependencies(PsDependencyCollection.kt:176)
    at com.android.tools.idea.gradle.structure.model.PsDeclaredDependencyCollection.refresh(PsDependencyCollection.kt:171)
    at com.android.tools.idea.gradle.structure.model.android.PsAndroidModule.init(PsAndroidModule.kt:90)
    at com.android.tools.idea.gradle.structure.model.PsModuleCollection.update(PsModuleCollection.kt:110)
    at com.android.tools.idea.gradle.structure.model.PsModuleCollection.update(PsModuleCollection.kt:38)
    at com.android.tools.idea.gradle.structure.model.android.PsCollectionBase.refresh(PsCollectionBase.kt:44)
    at com.android.tools.idea.gradle.structure.model.PsProjectImpl.applyChanges(PsProjectImpl.kt:111)
    at com.android.tools.idea.gradle.structure.configurables.PsContextImpl.applyChanges(PsContextImpl.kt:218)
    at com.android.tools.idea.gradle.structure.configurables.ProjectPerspectiveConfigurable.apply(ProjectPerspectiveConfigurable.kt:49)
    at com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.apply(ProjectStructureConfigurable.kt:384)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor.apply(ConfigurableEditor.java:324)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor.apply(ConfigurableEditor.java:135)
    at com.intellij.openapi.options.newEditor.SettingsDialog.applyAndClose(SettingsDialog.java:197)
    at com.intellij.openapi.options.newEditor.SettingsDialog.doOKAction(SettingsDialog.java:193)
    at com.android.tools.idea.structure.dialog.ProjectStructureConfigurable$showDialog$dialog$1.doOKAction(ProjectStructureConfigurable.kt:294)
    at com.intellij.openapi.ui.DialogWrapper$OkAction.doAction(DialogWrapper.java:1881)
    at com.intellij.openapi.ui.DialogWrapper$DialogWrapperAction.actionPerformed(DialogWrapper.java:1834)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at com.chrisrm.idea.ui.MTButtonUI$ButtonHighlighter.mouseReleased(MTButtonUI.java:387)
    at java.awt.Component.processMouseEvent(Component.java:6550)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
    at java.awt.Component.processEvent(Component.java:6315)
    at java.awt.Container.processEvent(Container.java:2239)
    at java.awt.Component.dispatchEventImpl(Component.java:4899)
    at java.awt.Container.dispatchEventImpl(Container.java:2297)
    at java.awt.Component.dispatchEvent(Component.java:4721)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
    at java.awt.Container.dispatchEventImpl(Container.java:2283)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.C
like image 743
Arpit Patel Avatar asked Jun 04 '20 23:06

Arpit Patel


People also ask

Why did my Gradle sync fail?

Gradle sync failed: Cause: invalid type code: 1C. This is because of using a very recent version of Java JDK(version 14). To fix this problem go to File->Project Structure->JDK->Choose the EnbeddedJDK option.

How to update Gradle in Android Studio?

To update Gradle, click in the Android Studio tab: File -> Project Structure -> Project. Then, change the Gradle version to 6.5.1. Thanks, it was very helpfull! Show activity on this post.

What is Gradle and how to use it?

Gradle is nothing but a build system that takes all your source files and converts them into APK (Android Application Package) format. The latter is the file format the Android Operating System uses to distribute and install mobile apps. So we need a gradle to use necessary tools to make that happen.

How to fix Android Studio not responding to Android Studio errors?

Step 1: First delete .gradle and .idea folder from project directory and restart Android Studio. Make sure it's gone from recycle bin. Step 3: Select SDK Location from the left panel on Project Structure window. And it will Solve the errors. Rebuild the project


Video Answer


2 Answers

This is an issue with the JDK version being too recent, as shown in this line:

CsvFileTypeOverrider: net/seesharpsoft/intellij/plugins/csv/CsvFileTypeOverrider has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I had a similar bug where Gradle sync died immediately with the Cause: invalid type code: 1C error. Switching the JDK from OpenJDK 14 I installed to the integrated JDK that comes bundled with Android Studio fixed the issue.

To switch the JDK version, go to File > Project Structure, select "SDK Location" on the left sidebar, and under "JDK Location" select the dropdown arrow and then select Embedded JDK: C:\Users\user\...

JDK location image

like image 145
so5user5 Avatar answered Oct 17 '22 05:10

so5user5


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: 85

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.

like image 2
Arpit Patel Avatar answered Oct 17 '22 05:10

Arpit Patel