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

IntelliJ plugin crashes 100% of the time with IntelliJ 2024.2 #1132

Closed
SledgeHammer01 opened this issue Aug 7, 2024 · 10 comments · Fixed by #1142
Closed

IntelliJ plugin crashes 100% of the time with IntelliJ 2024.2 #1132

SledgeHammer01 opened this issue Aug 7, 2024 · 10 comments · Fixed by #1142
Labels

Comments

@SledgeHammer01
Copy link

Whenever I open a project in IntelliJ 2024.2 that uses the plugin, the plugin crashes with:

java.lang.Throwable: com.google.googlejavaformat.intellij.InitialConfigurationStartupActivity <clinit> requests com.intellij.notification.NotificationGroupManager instance. Class initialization must not depend on services. Consider using instance of the service on-demand instead.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.intellij.serviceContainer.ComponentManagerImplKt.checkOutsideClassInitializer(ComponentManagerImpl.kt:1588)
	at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1557)
	at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:746)
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:690)
	at com.intellij.notification.NotificationGroupManager.getInstance(NotificationGroupManager.java:19)
	at com.google.googlejavaformat.intellij.InitialConfigurationStartupActivity.<clinit>(InitialConfigurationStartupActivity.java:31)
	at java.base/jdk.internal.misc.Unsafe.allocateInstance(Native Method)
	at java.base/java.lang.invoke.DirectMethodHandle.allocateInstance(DirectMethodHandle.java:501)
	at com.intellij.serviceContainer.ComponentManagerImpl.findConstructorAndInstantiateClass(ComponentManagerImpl.kt:900)
	at com.intellij.serviceContainer.ComponentManagerImpl.doInstantiateClass(ComponentManagerImpl.kt:909)
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:894)
	at com.intellij.openapi.extensions.impl.SimpleConstructorInjectionAdapter.instantiateClass(XmlExtensionAdapter.kt:103)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.doCreateInstance(XmlExtensionAdapter.kt:52)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.kt:33)
	at com.intellij.openapi.extensions.ExtensionPointNameKt.createOrError(ExtensionPointName.kt:336)
	at com.intellij.openapi.extensions.ExtensionPointNameKt.access$createOrError(ExtensionPointName.kt:1)
	at com.intellij.openapi.extensions.LazyExtensionImpl.getInstance(ExtensionPointName.kt:311)
	at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.kt:245)
	at com.intellij.ide.startup.impl.StartupManagerImpl.access$runPostStartupActivities(StartupManagerImpl.kt:69)
	at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$3$2.invokeSuspend(StartupManagerImpl.kt:193)
	at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$3$2.invoke(StartupManagerImpl.kt)
	at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$3$2.invoke(StartupManagerImpl.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$3.invokeSuspend(StartupManagerImpl.kt:192)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)

@SListSopra
Copy link

+1

@swissclash79
Copy link

I have the same issue.

@nam178
Copy link

nam178 commented Aug 14, 2024

Same issue. Please fix

@dengdg
Copy link

dengdg commented Aug 14, 2024

+1

@jcawley-eci
Copy link

+1

@afrech-applaudo
Copy link

Same issue here.

@jimshowalter
Copy link

+1

copybara-service bot pushed a commit that referenced this issue Aug 21, 2024
Fixes the error on startup by loading the service when needed and not when the class is initializing.  IntelliJ docs on this, https://plugins.jetbrains.com/docs/intellij/plugin-services.html#retrieving-a-service.

Tested locally with IntelliJ versions 2021.3 and 2024.2.

#1134 has bug #1132 tagged, but I don't think it does anything to resolve the issue in it's current state. (I do agree that getting on the newer IntelliJ tooling is beneficial though, it offers inspections that catches issues like this.)

Fixes #1132.

Fixes #1138

FUTURE_COPYBARA_INTEGRATE_REVIEW=#1138 from nrayburn-tech:fix/1132 5866980
PiperOrigin-RevId: 665849974
copybara-service bot pushed a commit that referenced this issue Aug 21, 2024
Hello,

I have no experience in IntelliJ plugin development, but maybe I can support you that the required invest in time isn't that high. As far as I can tell the `gradle build` works.

Due to the changes of the IntelliJ gradle plugin I was urged to raise the java compatibility to 17 as well as the supported IntelliJ version to at least 2022.3 (see [requirements](https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#requirements))

#1132

Fixes #1134

FUTURE_COPYBARA_INTEGRATE_REVIEW=#1134 from mmaeller:gh-1132 abed210
PiperOrigin-RevId: 665850301
copybara-service bot pushed a commit that referenced this issue Aug 21, 2024
Hello,

I have no experience in IntelliJ plugin development, but maybe I can support you that the required invest in time isn't that high. As far as I can tell the `gradle build` works.

Due to the changes of the IntelliJ gradle plugin I was urged to raise the java compatibility to 17 as well as the supported IntelliJ version to at least 2022.3 (see [requirements](https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#requirements))

#1132

Fixes #1134

COPYBARA_INTEGRATE_REVIEW=#1134 from mmaeller:gh-1132 abed210
PiperOrigin-RevId: 665880070
@jimshowalter
Copy link

When will a release with this fix be available?

@SledgeHammer01
Copy link
Author

New plugin Showing up in IntelliJ now. No more crashes! Thank you!

@swissclash79
Copy link

Thank you! 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment