How to make gradle build in android project faster

2019-06-04 06:33发布

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?

2条回答
forever°为你锁心
2楼-- · 2019-06-04 07:10

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.

查看更多
可以哭但决不认输i
3楼-- · 2019-06-04 07:17

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

查看更多
登录 后发表回答