How to make gradle build in android project faster?

蓝咒 提交于 2019-12-08 07:20:55

问题


Now i have a project. When i build it with ant, it takes only 40 seconds. But when i build it with gradle, it takes me 3 minutes or 4 minutes, which is really to much for me.

How can i fasten my gradle build?


回答1:


It can help you if you run Gradle in daemon mode - https://twitter.com/timbray/status/512368955516657664




回答2:


If you have multiple cores try gradle --daemon --parallel build, otherwise if you lack multiple cores try gradle --daemon --parallel-threads <number of threads you want to spawn> build. I saw a speed improvement of 200% after the first invocation.



来源:https://stackoverflow.com/questions/25969207/how-to-make-gradle-build-in-android-project-faster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!