Loading script dependencies freeze

Hi, I’ve got the following problem: sometimes Kotlin: loading script dependencies step in AS freezes or passes in a very long time, sometimes it even freezes AS completely.

My project contains ~80 build.gradle.kts scripts, most of them consist of the similar plugins/dependencies blocks. Loading script dependencies seem to occur unrelated to interacting with *.gradle.kts files. I’d like to understand what triggers it and how to avoid it.

Also, there is buildSrc in my project and some of the plugins applied to project modules are from buildSrc (not sure if it matters).

I’m using AS 4.0 and gradle wrapper 6.5.1.

IIRC the new Android Studio Beta fixes this problem. Try it out and hopefully it might work.