GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
319 stars 59 forks source link

Solution - 'Gemini Code Assist/Cloud Code' requires plugin 'com.google.tools.ij.aiplugin' to be installed #3223

Open Jasonnor opened 1 month ago

Jasonnor commented 1 month ago

After updating the plugin to 24.8.1-233-api-version-223, the error mentioned in the title occurred.

I tried searching for 'com.google.tools.ij.aiplugin' in JetBrains Marketplace but couldn't find this plugin.

Expected Behavior

No plugin error.

Actual Behavior

image

Additional Information

Feel free to deviate from this template as needed, especially if you are submitting a feature request.

jochenkirstaetter commented 1 month ago

Hi @Jasonnor ,

(using Rider here but shall be same for PyCharm)

I run into the same issue yesterday and posted a solution on social media. You can install the missing plugin using the Rider shell script which is in the bin folder.

$ cd /snap/rider/current/bin
$ ./rider.sh installPlugins com.google.tools.ij.aiplugin

Rider needs to be closed and on next restart you have two plugins Code Assist and Cloud Code available.

Output below for reference for the repo maintainer. This happens when upgrading. New installation or removing the plugin and re-installation seems to work as expected though.

$ ./rider.sh installPlugins com.google.tools.ij.aiplugin
Debug | ByteBufferAsyncProcessor  | 40:DefaultDispatcher-worker-17 | PAUSE ('Socket not connected') :: {id = EarlyStartServerWire/Sender, state = 'Initialized'} 
Debug | Server                    | 56:EarlyStartServerWire | EarlyStartServerWire: listening /127.0.0.1:43265 
2024-08-16 08:33:48,075 [    203] SEVERE - #c.i.i.p.PluginManager - Problems found loading plugins:
  The Gemini Code Assist/Cloud Code (id=com.google.gct.core, path=~/.local/share/JetBrains/Rider2024.2/google_cloud_code, version=24.8.1-233-api-version-223) plugin Plugin 'Gemini Code Assist/Cloud Code' requires plugin 'com.google.tools.ij.aiplugin' to be installed
java.lang.Throwable: Problems found loading plugins:
  The Gemini Code Assist/Cloud Code (id=com.google.gct.core, path=~/.local/share/JetBrains/Rider2024.2/google_cloud_code, version=24.8.1-233-api-version-223) plugin Plugin 'Gemini Code Assist/Cloud Code' requires plugin 'com.google.tools.ij.aiplugin' to be installed
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.intellij.ide.plugins.PluginManagerCore.preparePluginErrors(PluginManagerCore.kt:360)
    at com.intellij.ide.plugins.PluginManagerCore.initializePlugins(PluginManagerCore.kt:671)
    at com.intellij.ide.plugins.PluginManagerCore$initializeAndSetPlugins$2.invokeSuspend(PluginManagerCore.kt:870)
    at com.intellij.ide.plugins.PluginManagerCore$initializeAndSetPlugins$2.invoke(PluginManagerCore.kt)
    at com.intellij.ide.plugins.PluginManagerCore$initializeAndSetPlugins$2.invoke(PluginManagerCore.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.idea.Main$startApp$2$1$1.span(Main.kt:88)
    at com.intellij.diagnostic.CoroutineTracerShim.span$default(CoroutineTracerShim.kt:31)
    at com.intellij.ide.plugins.PluginManagerCore.initializeAndSetPlugins$intellij_platform_core_impl(PluginManagerCore.kt:869)
    at com.intellij.ide.plugins.PluginDescriptorLoader$scheduleLoading$pluginSetDeferred$1.invokeSuspend(PluginDescriptorLoader.kt:385)
    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)
2024-08-16 08:33:48,081 [    209] SEVERE - #c.i.i.p.PluginManager - JetBrains Rider 2024.2  Build #RD-242.20224.401
2024-08-16 08:33:48,081 [    209] SEVERE - #c.i.i.p.PluginManager - JDK: 21.0.3; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-08-16 08:33:48,082 [    210] SEVERE - #c.i.i.p.PluginManager - OS: Linux
Installation home directory: file:////snap/rider/488
System directory: file:////home/jochen/.cache/JetBrains/Rider2024.2
Config directory: file:////home/jochen/.config/JetBrains/Rider2024.2
Log directory: file:////home/jochen/.cache/JetBrains/Rider2024.2/log
2024-08-16 08:33:49,096 [   1224]   WARN - #c.i.o.e.c.i.EditorColorsManagerImpl - Skipping '_@user_Rider Dark' because its parent scheme 'Rider Dark' is missing.
2024-08-16 08:33:49,107 [   1235]   WARN - #c.i.o.e.c.i.EditorColorsManagerImpl - Rider Dark color scheme is missing
2024-08-16 08:33:49,225 [   1353]   WARN - o.j.n.l.LinuxTrustedCertificatesUtil - Not reading certificates from /etc/ssl/certs/ce275665.0: access denied
2024-08-16 08:33:49,227 [   1355]   WARN - o.j.n.l.LinuxTrustedCertificatesUtil - Not reading certificates from /etc/ssl/certs/https.pem: access denied
plugin repositories: [https://plugins.jetbrains.com/plugins/insiders/8079, null]
looking up plugins: [com.google.tools.ij.aiplugin]
2024-08-16 08:34:29,475 [  41603]   WARN - o.j.n.l.LinuxTrustedCertificatesUtil - Not reading certificates from /etc/ssl/certs/ce275665.0: access denied
2024-08-16 08:34:29,475 [  41603]   WARN - o.j.n.l.LinuxTrustedCertificatesUtil - Not reading certificates from /etc/ssl/certs/https.pem: access denied
installed plugin: PluginNode{id=com.google.tools.ij.aiplugin, name='Gemini Code Assist'}
kettlecat6 commented 1 month ago

For MacOS user:

~/Applications/GoLand.app/Contents/MacOS/goland installPlugins com.google.tools.ij.aiplugin

Jasonnor commented 1 month ago

@jochenkirstaetter

Thanks, I solved the problem with this command: /Applications/PyCharm.app/Contents/Helpers/PyCharm.app/Contents/MacOS/pycharm.sh installPlugins com.google.tools.ij.aiplugin

chybis commented 1 month ago

Similar for Windows (tested od Windows 10): c:\Program Files\JetBrains\PyCharm Community Edition 2024.2\bin\pycharm.bat installPlugins com.google.tools.ij.aiplugin

Alberto-Monteiro commented 4 weeks ago

On my Mac, I was able to install the plugin using the following command: /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea installPlugins com.google.tools.ij.aiplugin

It gave an error when I opened IntelliJ IDEA for the first time, but after restarting it a second time, everything worked fine.

ivanporty commented 4 weeks ago

This is a bug in IntelliJ when you upgrade the IDE where the plugin is not the latest, it upgrades the plugins, but doesn't upgrade the dependent plugins (which is now a separate Gemini plugin bundled with Cloud Code).

Solution 1: Upgrade plugin before IDE (one time only)

Before upgrading the IDE to the new major version (2024.2), update the plugins to the newest version, not vice versa. This is one time only. Once the bundle of two plugins is there, upgrade won't be an issue anymore.

Solution 2: Remove the plugin and reinstall it if run into mentioned issue after the upgrade.

image (4)

(a) Right click on the plugin and uninstall. You will not see a restart button yet due to IDE bug. Close settings. Re-open settings, and you will see "Restart". Restart IDE as prompted now. You must do this to remove the plugin incorrectly installed by IntelliJ (re-open settings and restart)

Screenshot 2024-08-16 at 10 57 42 AM

(b) after IDE restart, re-install Cloud Code from the marketplace to the latest version (24.8.1 as of now). Then restart

Screenshot 2024-08-16 at 10 58 20 AM

Plugin will install needed dependencies correctly and will work correctly.

ivanporty commented 3 weeks ago

IDE fix tracking here: https://youtrack.jetbrains.com/issue/IJPL-160110/Implement-a-general-solution-to-install-plugins-dependencies-during-IDE-update

Ocoyack commented 3 weeks ago

for debian 12: cd ~/.local/share/JetBrains/Toolbox/apps/pycharm-professional/bin sudo ./pycharm.sh installPlugins com.google.tools.ij.aiplugin sudo ./idea.sh installPlugins com.google.tools.ij.aiplugin

SOLVED: Reinstall plugin from officlal page: https://plugins.jetbrains.com/plugin/8079-gemini-code-assist-cloud-code