Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version incompatible with Kotlin 1.4 #532

Closed
amandeepg opened this issue Sep 9, 2020 · 2 comments
Closed

Latest version incompatible with Kotlin 1.4 #532

amandeepg opened this issue Sep 9, 2020 · 2 comments
Assignees
Milestone

Comments

@amandeepg
Copy link

amandeepg commented Sep 9, 2020

We are using Kotlin 1.4 with serialization, with this plugin, so that brings in the dependencies org.jetbrains.intellij.plugins:structure-intellij:3.105 (from the latest version of gradle-intellij-plugin) and org.jetbrains.kotlinx:kotlinx-serialization-runtime:1.0-M1-1.4.0-rc from Kotlin 1.4.

However this crashes during the configuration step with the following stack trace:

Caused by: java.lang.InstantiationError: kotlinx.serialization.json.Json	
	at com.jetbrains.plugin.structure.intellij.plugin.PluginCreator.<clinit>(PluginCreator.kt:45)	
	at com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager.loadPluginInfoFromJarFile(IdePluginManager.java:109)	
	at com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager.loadPluginInfoFromLibDirectory(IdePluginManager.java:213)	
	at com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager.loadPluginInfoFromDirectory(IdePluginManager.java:152)	
	at com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager.loadPluginInfoFromJarOrDirectory(IdePluginManager.java:312)	
	at com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager.getPluginCreatorWithResult(IdePluginManager.java:448)	
	at com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager.createPlugin(IdePluginManager.java:425)	
	at com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager.createPlugin(IdePluginManager.java:418)	
	at com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager$createPlugin$0.call(Unknown Source)	
	at org.jetbrains.intellij.Utils.createPlugin(Utils.groovy:324)	
	at org.jetbrains.intellij.Utils$createPlugin$5.call(Unknown Source)	
	at org.jetbrains.intellij.dependency.BuiltinPluginsRegistry.add(BuiltinPluginsRegistry.groovy:117)	
	at org.jetbrains.intellij.dependency.BuiltinPluginsRegistry$add$0.callCurrent(Unknown Source)	
	at org.jetbrains.intellij.dependency.BuiltinPluginsRegistry.fillFromDirectory(BuiltinPluginsRegistry.groovy:52)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
	at org.jetbrains.intellij.dependency.BuiltinPluginsRegistry.fromDirectory(BuiltinPluginsRegistry.groovy:22)	
	at org.jetbrains.intellij.dependency.BuiltinPluginsRegistry$fromDirectory.call(Unknown Source)	
	at org.jetbrains.intellij.dependency.IdeaDependencyManager.createDependency(IdeaDependencyManager.groovy:112)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
	at org.jetbrains.intellij.dependency.IdeaDependencyManager.resolveRemote(IdeaDependencyManager.groovy:63)	
	at org.jetbrains.intellij.dependency.IdeaDependencyManager$resolveRemote.call(Unknown Source)	
	at org.jetbrains.intellij.IntelliJPlugin.configureIntellijDependency(IntelliJPlugin.groovy:198)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
	at org.jetbrains.intellij.IntelliJPlugin.configureProjectAfterEvaluate(IntelliJPlugin.groovy:134)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
	at org.jetbrains.intellij.IntelliJPlugin$_configureTasks_closure4.doCall(IntelliJPlugin.groovy:119)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
	...

It appears that structure-intellij:3.105 is build against Kotlin 1.3, causing this incompatibility. Upgrading the dependency to 1.4 in structure-intellij I believe should fix this. For now we have downgraded to gradle-intellij-plugin:0.4.18 as it doesn't use a version of structure-intellij incompatible with Kotlin 1.4.

Here's a screenshot of a Gradle scan showing the version upgrade done by Gradle during the build:
Screen Shot 2020-09-09 at 1 49 13 PM

Also reported this to IntelliJ's YouTrack: https://youtrack.jetbrains.com/issue/IDEA-250454

@zolotov zolotov self-assigned this Sep 14, 2020
@zolotov
Copy link
Member

zolotov commented Sep 14, 2020

Could you provide steps to recreate the issue, please? I'm not quite understand how classpath of gradle-intellij-plugin affects the compile classpath of your project.

@amandeepg
Copy link
Author

Sure, I've uploaded a project that has the configuration I specified, namely using the org.jetbrains.intellij plugin along with kotlinx-serialization in the buildscript using the latest version from https://github.com/Kotlin/kotlinx.serialization#dependency-on-the-runtime-library.

You can see the failure by running rm -rf ~/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ ; ./gradlew tasks --scan, and I've uploaded the scan, here's a link to the scan, specifically to where it reports the version upgrade: https://scans.gradle.com/s/7icr64l5blqpe/build-dependencies?toggled=W1swXSxbMCwwXSxbMCwwLFsxXV0sWzAsMCxbMSwyXV0sWzAsMCxbMSwyLDM3XV0sWzAsMCxbMSwyLDM3LDQyXV1d

gradle-intellij-plugin_issues_532.zip

@zolotov zolotov added this to the 0.4.23 milestone Sep 17, 2020
@zolotov zolotov closed this as completed Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants