How can I debug why is Gradle taking too long (> 9 minutes) to "build model"?
Answered
When I choose to "Reload All Gradle Projects" from the Gradle tool window, Gradle spends too long to build model.
This is probably an issue in my project but how can I start debugging it? Like what Gradle command is IntelliJ running to build that model?

Please sign in to leave a comment.
I also have this problem with the current version and I'm not sure if my project will open at all. I have been waiting for 25 minutes for my Gradle project to open. Only these entries appear in the log:
2023-04-11 13:01:42,314 [1116194] INFO - #c.i.c.ComponentStoreImpl - Saving Project(name=xy, containerState=COMPONENT_CREATED, componentStore=C:\projectfiles\xy)RunManager took 11 ms.
2023-04-11 13:02:47,954 [1181834] INFO - #c.i.w.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
2023-04-11 13:04:51,131 [1305011] INFO - #c.i.w.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
2023-04-11 13:06:10,009 [1383889] INFO - #c.i.w.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
2023-04-11 13:06:10,085 [1383965] INFO - #c.i.c.ComponentStoreImpl - Saving Project(name=xy, containerState=COMPONENT_CREATED, componentStore=C:\projectfiles\xy)Kotlin2JvmCompilerArguments took 13 ms
2023-04-11 13:06:42,507 [1416387] INFO - #c.i.w.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
2023-04-11 13:07:17,732 [1451612] INFO - #c.i.w.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
2023-04-11 13:07:23,294 [1457174] INFO - #c.i.w.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
2023-04-11 13:08:20,736 [1514616] INFO - #c.i.w.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
Hello,
There is related issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-266737/Importing-gradle-project-stuck-at-Build-model...
Please try suggestions from comments.
Adding org.gradle.logging.level=INFO to our gradle.properties file helped a lot in finding the problem. You can use DEBUG instead of INFO isn't enough.