cloud-code-intellij icon indicating copy to clipboard operation
cloud-code-intellij copied to clipboard

Gemini and Android plugin conflict

Open PabloVKF opened this issue 1 year ago • 7 comments

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.

image

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)

{6F53588C-DE3E-437B-9FE1-DC9F4D5746B1}

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]

{AFFE069F-879C-4FE2-A5A8-372E89CBBA29}

{AAC14390-4F48-42AE-9560-99DBC14442ED}

Originally posted by @PabloVKF in https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues/3222#issuecomment-2571713771

PabloVKF avatar Jan 07 '25 13:01 PabloVKF

Thanks for the report @PabloVKF. We are looking into this

ivanporty avatar Jan 10 '25 21:01 ivanporty

Same problem here with different plugin versions :

Image

I'm using the community version of Intellij, could that be the problem ?

Greg41941 avatar Jan 28 '25 13:01 Greg41941

Thanks for the report @Greg41941, we will look into this and will let you know when the fix is coming.

ivanporty avatar Jan 28 '25 21:01 ivanporty

Upgrading to Ultimate Edition fixed the problem on my end

Greg41941 avatar Feb 11 '25 08:02 Greg41941

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.

ivanporty avatar Feb 20 '25 18:02 ivanporty

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)

amitsinghspice avatar Mar 03 '25 03:03 amitsinghspice

#3244

asefa2016 avatar Mar 31 '25 01:03 asefa2016