I'm trying to debug an issue as to why a sync on m...
# community-support
c
I'm trying to debug an issue as to why a sync on my new teams codebase takes like 30 seconds each time you sync. You can simply just add a
val blah = 0
to the build file (app build file specifically since this is an android project) and if I hit sync, it'll take 30 seconds. I figured it out. Ordering of repositories was wrong so it was going to one really slow maven repo mirror first which never had anything. Cool problem solved... but now I'm starting to go a little stir crazy. what does adding
val blah = 0
require a dependency refresh. i could literally sync, wait 30 seconds, add
val blah2 = 0
sync and its gotta wait 30 seconds again. I thought the point of gradle is that it caches these things so it wouldn't need to check in for each dep again. I feel like I'm misunderstanding something and claude/codex are giving me conflicting answers.
e
Gradle will of course have to recompile that build script, and the IDE doesn't understand what's changed. as far as I understand, the sync model isn't a build output that Gradle tracks, it's something that the IDE captures by queries through the tooling API, so it isn't incremental or cached
c
interesting. i guess since i found a 30 second slowdown, i noticed that still scanning all the repos besides the problematic repo still takes a few seconds. i guess maybe in my head a sync always runs when you hit run button in studio. but i guess not so maybe its not as big a deal as i think
e
no it doesn't sync every time you run
Gradle configuration needs to happen (which may be cached) before task execution
v
Also, it is documented best practice to use repository content filters if you have multiple repos, so you might also want to add that.
c
yeah. thats what i did with with the aws speicifc issue i had yesterday lol, but yeah the other repos take 6 seconds still so i was curious if I should be seeing syncs this often anyway. i swear this come up as an issue when I did a graldle profiler session a few weeks ago, but i ended up going into gradle offline mode for my profiler runs