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

前端 未结 28 2269
太阳男子
太阳男子 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:51

    This setup goes really fast for me (about 2 seconds the build)

    build.gradle

    android {
    
        dexOptions {
            incremental true
            preDexLibraries = false
            jumboMode = false
            maxProcessCount 4
            javaMaxHeapSize "6g"
        }
    }
    

    gradle.properties

    org.gradle.daemon=true
    org.gradle.parallel=true
    org.gradle.jvmargs=-Xmx8192M
    

    my PC:

    • CPU Intel(R) Pentium(R) CPU G2030 @ 3.00GHz, 3000 Mhz, 2 procesadores principales, 2 procesadores lógicos
    • x64
    • Microsoft Windows 7 Professional
    • (RAM) 16,0 GB

    project files
    - All located in local HD

提交回复
热议问题