Android studio very slow gradle build

后端 未结 2 1648
名媛妹妹
名媛妹妹 2021-01-17 22:15

I\'m new to Android Studio..whenever I run my project it takes around 14 mins for gradle build..I\'ve check for solutions to improve build speed as mentioned in here

相关标签:
2条回答
  • 2021-01-17 22:37

    Solution for Linux/OSX may looks like this:

    echo 'org.gradle.daemon=true' >> ~/.gradle/gradle.properties
    
    echo 'org.gradle.configureondemand=true' >> ~/.gradle/gradle.properties
    
    echo 'org.gradle.parallel=true' >> ~/.gradle/gradle.properties
    
    echo 'org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8' >> ~/.gradle/gradle.properties
    

    Using these commands you make changes in global gradle.properties file.

    More info (together with detailed explanation) can he found here.

    0 讨论(0)
  • 2021-01-17 22:51

    make gradle.propertiesfile in C:\Users\<username>\.gradle (Windows)

    then,Add this line to the file:

    org.gradle.daemon=true
    
    0 讨论(0)
提交回复
热议问题