How to increase maximum heap size for the Gradle daemon?

前端 未结 5 1025
孤街浪徒
孤街浪徒 2021-02-20 07:41

When signin an apk, I got this message:

To run dex in process, the Gradle daemon needs a larger heap.
It currently has 1024 MB.
For faster builds, increase the m         


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-02-20 08:11

    You can try any one of the following

    1) change the gradle.properties file and change the heap size as per your requirement.

    If org.gradle.jvmargs=-Xmx2048M is not sufficient then change to 4096 as given

    org.gradle.jvmargs=-Xmx4096M

    2)"Edit Custom VM Options" from the Help menu.

    It will open studio.vmoptions / studio64.exe.vmoptions file

    Change the content to

    -Xms128m

    -Xmx4096m

    -XX:MaxPermSize=1024m

    -XX:ReservedCodeCacheSize=200m

    -XX:+UseCompressedOops

    Save the the file and restart Android Studio.

提交回复
热议问题