22

In Android Studio 0.2.0, whenever I type anything in my build.gradle files, Gradle decides it's time to rebuild. This takes a long time, generates noise and kills my battery life. It never ends as well, at least not until I finish editing the file… always rebuilding as I type. Lucky me I use Ubuntu with plenty of free memory.

So… I'd like to deactivate any option to auto make stuff. This is what I've tried so far:

  • Checking "File" | "Power Save Mode" in the menu.
  • Unchecking all options and all combinations between them in "Compiler" options, especially "Make Project Automatically".

Nothing works. I'd like a way to only build when I ask. Like a manual mode with a button. Something like that.

I understand Android Studio and the whole build system is very new, with lots of rough edges, but I'm hoping it's just a matter of an obscure flag definition in a file somewhere.


Previous research: this question does not provide enough details or goals, so I made my own. This G+ thread was a dead end as well. I'm still getting used to the new stuff and may be lost searching (i.e., missing the right keywords etc.), so sorry in advance if there are no updates on this issue.

Thank you.

Community
  • 1
  • 1
davidcesarino
  • 16,160
  • 16
  • 68
  • 109

2 Answers2

17

under preferences > Gradle you can disable auto-import. With it selected it'll reimport the gradle project (which right now builds it first) every time you change the file.

Xavier Ducrohet
  • 28,383
  • 5
  • 88
  • 64
  • 7
    This option as disappeared in the current release (1.2 beta) of Android Studio – Snicolas Apr 10 '15 at 15:59
  • 1
    this option is still missing as of 1.3 -- has anyone found a workaround? I've been staring at a frozen IDE for five minutes now! All I wanted to do was modify the output apk name [http://stackoverflow.com/questions/28249036/app-release-apk-how-to-change-this-default-generated-apk-name]... – CCJ Nov 05 '15 at 21:05
  • 2
    im not able to find "Preference " tab in the menu bar of the android studio? – SIVAKUMAR.J Sep 08 '17 at 14:16
4

Additionally, if you are using Kotlin build script (Kotlin DSL), after disabled auto-import like @Xavier said, you need one more step: uncheck the Auto Reload checkbox of KotlinBuildScript under preference -> languages & frameworks -> Kotlin -> Kotlin Scripting.

uncheck the auto-reload checkbox of KotlinBuildScript

TonnyL
  • 1,226
  • 1
  • 12
  • 17