Gemini and Android plugin conflict
The conflict warning is gone, but it still doesn't work if you keep the Android plugin active. I've disabled and enabled the Android plugin several times to be sure, and Gemini only works with it disabled.
com.intellij.platform.instanceContainer.internal.InstanceAlreadyRegisteredException: com.android.tools.idea.studiobot.StudioBot is already registered: com.android.tools.idea.studiobot.StudioBot$StubStudioBot. Failed to register: com.android.studio.ml.api.StudioBotImpl.
at com.intellij.platform.instanceContainer.internal.InstanceRegistrarImpl.registerInitializer(InstanceRegistrarImpl.kt:33)
at com.intellij.serviceContainer.ComponentManagerImpl.registerServices2Inner(ComponentManagerImpl.kt:626)
at com.intellij.serviceContainer.ComponentManagerImpl.registerServices(ComponentManagerImpl.kt:563)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:331)
at com.intellij.openapi.client.ClientAwareComponentManager.registerComponents(ClientAwareComponentManager.kt:65)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents$default(ComponentManagerImpl.kt:313)
at com.intellij.platform.ide.bootstrap.ApplicationLoader$loadApp$2$initServiceContainerJob$1$1.invokeSuspend(ApplicationLoader.kt:103)
at com.intellij.platform.ide.bootstrap.ApplicationLoader$loadApp$2$initServiceContainerJob$1$1.invoke(ApplicationLoader.kt)
at com.intellij.platform.ide.bootstrap.ApplicationLoader$loadApp$2$initServiceContainerJob$1$1.invoke(ApplicationLoader.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.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:48)
at com.intellij.platform.ide.bootstrap.ApplicationLoader$loadApp$2$initServiceContainerJob$1.invokeSuspend(ApplicationLoader.kt:102)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:277)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
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)
Unhandled exception in Dispatchers.Default
java.lang.ClassCastException: class com.android.tools.idea.studiobot.StudioBot$StubStudioBot cannot be cast to class com.android.tools.idea.studiobot.StudioBot (com.android.tools.idea.studiobot.StudioBot$StubStudioBot is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @7f37149d; com.android.tools.idea.studiobot.StudioBot is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @38867e8f)
at com.android.studio.ml.completion.SmlInlineCompletionStatusBarWidgetFactory$Widget.determineCurrentStatus(SmlInlineCompletionStatusBarWidgetFactory.kt:391)
at com.android.studio.ml.completion.SmlInlineCompletionStatusBarWidgetFactory$Widget.access$determineCurrentStatus(SmlInlineCompletionStatusBarWidgetFactory.kt:95)
at com.android.studio.ml.completion.SmlInlineCompletionStatusBarWidgetFactory$Widget$2.invokeSuspend(SmlInlineCompletionStatusBarWidgetFactory.kt:113)
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)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelled}@6cd9fd8a, Dispatchers.Default]
Originally posted by @PabloVKF in https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues/3222#issuecomment-2571713771
Thanks for the report @PabloVKF. We are looking into this
Same problem here with different plugin versions :
I'm using the community version of Intellij, could that be the problem ?
Thanks for the report @Greg41941, we will look into this and will let you know when the fix is coming.
Upgrading to Ultimate Edition fixed the problem on my end
There should be no conflict between Gemini Code Assist and Android plugin in general, but since two may use some shared code, it's crucial for Android plugin to be up to date. Android Studio is updated on time, but Android plugin is subject to Jetbrains update schedule and may lag behind, we cannot influence this easily. If you see the conflict, try older GCA plugin version, or wait until Android plugin is updated to the latest.
Unhandled exception in Dispatchers.Default
java.lang.ClassCastException: class com.android.tools.idea.studiobot.StudioBot$StubStudioBot cannot be cast to class com.android.tools.idea.studiobot.StudioBot (com.android.tools.idea.studiobot.StudioBot$StubStudioBot is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @1daf4426; com.android.tools.idea.studiobot.StudioBot is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @6853aa79)
#3244