Why does assembleDebug take much longer than building a project and how to optimize it?

Recently, I have been working with gradle build time in Android Studio. I managed to reduce the build time from 3 minutes to 10 seconds by removing some dependencies, but here's what:

When I rebuild the project, it takes about 10 seconds:

15:13:43 Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources]
15:13:54 Gradle build finished in 11s 596ms

However, when I run the application, it takes a lot longer, after about a minute:

15:15:09 Executing tasks: [:app:assembleDebug]
15:15:58 Gradle build finished in 49s 676ms

What is the reason for such a big difference? Is it still due to a lot of gradle dependencies or something else? Is there any way to reduce assembly time?

+4
source share
1 answer

Why:

multidex , 65 . . Dexing - , .

:

(ctrl + alt + s) β†’ , , β†’

"--offline" 15 .

enter image description here

+2

Source: https://habr.com/ru/post/1624429/


All Articles