mdddj / dd_flutter_idea_plugin

flutter dio idea plugin
https://flutterx.itbug.shop
MIT License
42 stars 4 forks source link

Class initialization must not depend on services. #52

Open mdddj opened 2 months ago

mdddj commented 2 months ago
java.lang.Throwable: shop.itbug.fluttercheckversionx.form.actions.ProjectFilter <clinit> requests shop.itbug.fluttercheckversionx.socket.service.AppService 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 shop.itbug.fluttercheckversionx.socket.service.AppService$Companion.getInstance(AppService.kt:142)
    at shop.itbug.fluttercheckversionx.form.actions.ProjectFilter.<init>(ProjectFilter.kt:21)
    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.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:935)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.instantiate(ActionManagerImpl.kt:1460)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.convertStub(ActionManagerImpl.kt:1696)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.getAction(ActionManagerImpl.kt:2178)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.access$getAction(ActionManagerImpl.kt:1)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.kt:422)
    at shop.itbug.fluttercheckversionx.form.actions.ProjectFilter.<clinit>(ProjectFilter.kt:63)
    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.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:935)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.instantiate(ActionManagerImpl.kt:1460)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.convertStub(ActionManagerImpl.kt:1696)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.getAction(ActionManagerImpl.kt:2178)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImplKt.access$getAction(ActionManagerImpl.kt:1)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.kt:422)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$loadAction$2.invokeSuspend(ActionAsyncProvider.kt:375)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$loadAction$2.invoke(ActionAsyncProvider.kt)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$loadAction$2.invoke(ActionAsyncProvider.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.util.gotoByName.ActionAsyncProvider.loadAction(ActionAsyncProvider.kt:374)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider.access$loadAction(ActionAsyncProvider.kt:35)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$unmatchedStubsFlow$$inlined$transform$1$1.emit(Emitters.kt:220)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$unmatchedStubsFlow$$inlined$filter$1$2.emit(Emitters.kt:219)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$unmatchedStubsFlow$$inlined$mapNotNull$1$2.emit(Emitters.kt:223)
    at kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$3.collect(SafeCollector.common.kt:114)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$unmatchedStubsFlow$$inlined$mapNotNull$1.collect(SafeCollector.common.kt:112)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$unmatchedStubsFlow$$inlined$filter$1.collect(SafeCollector.common.kt:112)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$unmatchedStubsFlow$$inlined$transform$1.invokeSuspend(Emitters.kt:36)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$unmatchedStubsFlow$$inlined$transform$1.invoke(Emitters.kt)
    at com.intellij.ide.util.gotoByName.ActionAsyncProvider$unmatchedStubsFlow$$inlined$transform$1.invoke(Emitters.kt)
    at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:57)
    at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:226)
    at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:191)
    at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:153)
    at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(ChannelFlow.kt)
    at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:56)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
    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)