Building and running app via Gradle and Android Studio is slower than via Eclipse

前端 未结 28 1914
太阳男子
太阳男子 2020-11-22 08:21

I have a multi-project (~10 modules) of which building takes about 20-30 seconds each time. When I press Run in Android Studio, I have to wait every time to rebuild the app,

28条回答
  •  不思量自难忘°
    2020-11-22 08:45

    Just another performance imporvement tip:

    Android Studio 3.0 includes new DEX compiler called D8.

    "The dex compiler mostly works under the hood in your day-to-day app development, but it directly impacts your app's build time, .dex file size, and runtime performance."

    "And when comparing the new D8 compiler with the current DX compiler, D8 compiles faster and outputs smaller .dex files, while having the same or better app runtime performance."

    D8 is optional - do use it we have to put to project's gradle.properties

    android.enableD8=true
    

    More informations: https://android-developers.googleblog.com/2017/08/next-generation-dex-compiler-now-in.html

    PS. It impove my build time by about 30%.

提交回复
热议问题