Reputation: 635
Every time I load Android Studio (1.5), it runs gradle sync, even though nothing has changed since the last run. The funny thing is that a project that sync-ed properly yesterday will fail for random reasons today. Such as "Error:Cause: peer not authenticated" or "Could not reserve enough space for object heap".
Could I disable automatic gradle sync at startup?
Upvotes: 13
Views: 20803
Reputation: 2521
My gradle kept syncing files automatically whenever I changed something to my build.gradle
, this became so annoying since it doesn't give you the chance to finish writing something before switching you to another tab.
None of the answers above helped me, so I updated my version from Android Studio Electric Eel | 2022.1.1 Patch 2
to Android Studio Flamingo | 2022.2.1
and still had the issue.
The option Synchronize files on frame or editor tab activation
under Settings -> Appearance & Behavior -> System Settings
is mussing in these new versions.
It seems like the new Android Studio versions have a bug that was causing this issue. So in order to fix it, follow these steps:
Open your gradle
side panel (Right side)
Click on the three dots to show more options
Check the option Reload project after changes in the build scripts
Uncheck the option Reload project after changes in the build scripts
You can find this option under Settings -> Build, Execution, Deployment -> Build Tools
Or if you are using MacOS Preferences -> Build, Execution, Deployment -> Build Tools
Restart Android Studio
Upvotes: 0
Reputation: 666
EDIT: It looks like this feature has been removed in the latest versions.
This is a little late, but for anyone else looking:
In "Settings" -> "Appearance & Behavior" -> "System Settings"
Uncheck "Synchronize files on frame or editor tab activation"
You'll have to remember to hit the "Sync Project with Gradle Files" button whenever you make changes to Gradle. (To the left of AVD Manager)
Upvotes: 16
Reputation: 51
You can disable auto sync using below steps
Settings -> Appearance & Behavior -> System Settings Uncheck Synchronize files on frame or editor tab activation
Upvotes: 2
Reputation: 18627
You can disable autoimport in Settings (Preferences) > Build... > Build Tools > Gradle
See How to disable automatic gradle builds?
Upvotes: 1