一切都适用于一个小的Hello World应用程序.但是当我开始编辑我们从Eclipse移过的一个大项目的build.gradle时,IDE挂起了20或30秒.即使我不添加或删除任何行,它也会挂起.即使我只是按回车.此外,我没有看到任何进程运行(索引,同步等)在底部.
我检查了文件 – >设置 – > Gradle和Use auto-import未被选中.
正如他们建议的那样,我运行了jstack -l< pid> > dump.txt并在https://code.google.com/p/android/issues/detail?id=82706#c35上发布了一个消息以及dump.txt
我不能在这里附加相同的dump.txt,因为它包含大约800行.
解决方法
你会在这个线程中看到我的评论,但我也会在这里发布
I did find out WHY my build.grade would hang upon touching (any amount
of editing once so ever).I had a statement where I would iterate over all the variants and
would then iterate over each variant’s outputs and do a filter among
an xml file. Commenting the filter portion out would remove the
hanging/freezing problem. In fact only iterating over the first output
(of the first variant) would drastically reduce this lag time,still,
very annoying.I would suggest starting your build.gradle file from scratch and
adding parts progressively until you come across the portion in which
hangs the editing process.EITHER WAY,this hang shouldn’t happen since I’m merely editing the
file,not compiling nor running.Hopefully this can help someone