27

I inadvertently clicked the link to enable auto import of a Gradle project I was working on. How do I disable it for the current project? The only option I'm finding is for disabling it by default for all projects.

I'm on IDEA 2017.1.

M. Justin
  • 14,487
  • 7
  • 91
  • 130

1 Answers1

47

Auto import is disabled by default while editing (and enabled for external changes) and an icon is displayed in the top right of the build file editor after you make changes to the build file so that you can load the changes and perform the import:

Load Gradle Changes

In 2020.2+ versions automatic reload behavior can be configured at Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Reload project after changes in the build scripts:

reload 1

reload 2

Starting with 2020.1.2 version there is a 3-state option for importing changes, it's available for both Gradle and Maven:

3-state option

In 2020.1.1 version you can enable or disable the automatic reload of the external changes (option not present in 2020.1):

Auto-reload external changes

See also the related feature request to make the UI more obvious as it may be hard to notice a small icon suggesting to import the settings.


Before 2020.1 version you could disable it in Settings | Build, Execution, Deployment | Build Tools | Gradle | Use auto-import:

auto import

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • 3
    Thanks. I had seen this, but the checkbox was unchecked, so I thought this was the wrong place to change the value. Turns out that the settings window was sized small enough that the "Linked Gradle projects" list was only showing one item, and there was no obvious visual indicator that there was more than one of my modules in the list. In other words, I needed to switch the gradle project to the correct module, at which point I could make the change. – M. Justin Apr 03 '17 at 19:32
  • 1
    They should add a "pause" button in the build toolbar for gradle to temporarily turn this off instead of having to change the setting completely any time you want to just pause it to make a quick change without auto-import/building happening. – etech Apr 11 '19 at 14:00
  • 2
    Not available in IntelliJ 2020.1 anymore. – koppor Apr 14 '20 at 12:27
  • 1
    This has been fixed in the latest update for Idea 2020.1.1 (https://youtrack.jetbrains.com/issue/IDEA-237299#focus=streamItem-27-4115978.0-0) Link to the open issue stating the fix. (https://confluence.jetbrains.com/display/IDEADEV/IDEA+2020.1+latest+builds) Latest update notes – Starney May 01 '20 at 09:14