简体   繁体   English

添加Android设计支持库后,Gradle构建速度非常慢

[英]Gradle build is very slow after adding Android Design Support library

Android studio is building very slowly after adding Android Design Support library in gradle 在gradle中添加Android设计支持库后,Android工作室的构建速度非常慢

compile 'com.android.support:design:22.2.0'

but builds fast once I remove the above library, 30 seconds against 5 minutes, I am using TabLayout and Toolbar from the library hence I need it, not sure if its the library issue or the TabLayout itself taking time to load, 但是一旦我移除上面的库就会快速构建,30分钟反对5分钟,我正在使用库中的TabLayout和工具栏因此我需要它,不确定它是库问题还是TabLayout本身需要时间来加载,

Is there a way I can speed up the build process by any means ? 有没有办法可以通过任何方式加快构建过程?

Update: The actual reason was the company firewall, though proxy is set it takes lot of time to validate each incoming file and cause huge delay,so accepted answer should work to avoid frequent calls 更新:实际原因是公司防火墙,虽然设置了代理,但是需要花费大量时间来验证每个传入的文件并导致巨大延迟,因此接受的答案应该有效以避免频繁调用

After you synchronize gradle you can enable offline Gradle synchronization in Android Settings. 同步gradle后,您可以在Android设置中启用脱机Gradle同步。

To do that open the Android Studio Settings and then open 为此,请打开Android Studio设置,然后打开

Build, Execution, Deployment > Build Tool > Gradle 构建,执行,部署>构建工具> Gradle

and check Offline work checkbox in Global Gradle settings. 并选中Global Gradle设置中的Offline work复选框。

Now gradle will gets project dependecies from local cache 现在,gradle将从本地缓存中获取项目依赖性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM