android-studio – Android Studio 1.1.0在编辑build.gradle时挂起

我的机器有8 GB的RAM.我安装了 Android Studio 1.1.0并应用了他们发布的所有东西 here.

一切都适用于一个小的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行.

解决方法

经过一段时间研究这个问题,我发现这是Android问题跟踪器论坛中的一个活跃的问题.

https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=&id=59965

你会在这个线程中看到我的评论,但我也会在这里发布

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

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...