20

After installation of newest Android Studio I tried to install Lombok plugin
(Android Studio Bumblebee 2021.1.1 | Built on January 19, 2022)

But didn't find Lombok in Settings -> Plugins -> Marketplace

enter image description here

I found that the problem is:
Plugin 'Lombok' is not compatible with Android Studio build AI-211.7628.21

ModX
  • 829
  • 7
  • 10
  • you could check this [answer](https://stackoverflow.com/a/73349686/13773355) out to see if it helps! – Haoyu Wang Aug 14 '22 at 07:04
  • "The Lombok IntelliJ Plugin should be bundled in Android Studio 2023.1.1.8." see https://issuetracker.google.com/issues/266333624 and https://github.com/JetBrains/intellij-community/tree/master/plugins/lombok Do NOT try to 'side-load' the current Lombok plugin: this breaks auto-completion in Android Studio (in some cases) – Pascal Jul 14 '23 at 12:15

3 Answers3

40

How to fix it:

ModX
  • 829
  • 7
  • 10
12

After downloading the plugin file, version number needs to be changed.

I downloaded lombok-plugin-0.34-2020.2.zip from the releases (https://github.com/mplushnikov/lombok-intellij-plugin/releases), unzip it, went to the META-INF directory, open the jar file, changed in the xml file the line to <idea-version since-build="191.6183" until-build="IE-212.*"/> then saved the zip, installed the plugin from disk on Android Studio. Things seem to work - previous errors regarding unresolved getter functions now gone. Pretty brute force. Not sure if there will be side effects, but who knows if this plugin will only be updated after next year?

Edit: The best solution is to get rid of Lombok from your project. It's very easy in Android Studio from Refactor->Delombok.

LXJ
  • 1,180
  • 6
  • 18
3

EDIT 2023-07:

Using this "solution"does break code auto completion feature in some cases.
This is probably also true for other 'hackish' solutions listed on this page.

We should wait for lombok plugin to be part of Android Studio.

"The Lombok IntelliJ Plugin should be bundled in Android Studio 2023.1.1.8"
src: https://issuetracker.google.com/issues/266333624


This issue is help for me!!!

https://github.com/mplushnikov/lombok-intellij-plugin/issues/1028

  1. Download latest Lombok Plugin Lombok 0.34.1-2019.1

FYI, all plugin versions are available on JetBrains Marketplace and Github

  1. extract / unzip lombok-plugin-0.34-2020.2.jar from
    lombok-plugin-0.34.1-2019.1.zip/lombok-plugin/lib/lombok-plugin-0.34.1-2019.1.jar

  2. extract plugin.xml from
    lombok-plugin-0.34.1-2019.1.jar\META-INF\plugin.xml
    and change
    <idea-version since-build="191.6183" until-build="191.*">
    to
    <idea-version since-build="191.6183" until-build="999.*">

Why 999? To be future-proof :)

  1. Update / overwrite
    lombok-plugin-0.34.1-2019.1.jar\META-INF\plugin.xml
    with your modified plugin.xml file using this command:
    jar uf lombok-plugin-0.34-2020.2.jar META-INF\plugin.xml
    then

  2. Update / overwrite
    lombok-plugin-0.34.1-2019.1.zip/lombok-plugin/lib/lombok-plugin-0.34.1-2019.1.jar
    with your modified lombok-plugin-0.34.1-2019.1.jar file

  3. In Android Studio, select 'Install Plugin From Disk'
    enter image description here

  4. Select the modified lombok-plugin-0.34.1-2019.1.zip

  5. restart Android Studio

  6. enter image description here

good luck.

Pascal
  • 15,257
  • 2
  • 52
  • 65
normidar
  • 445
  • 5
  • 11