Android studio where is gradle.properties file?

AndroidAndroid StudioAndroid Gradle-Plugin

Android Problem Overview


I'm trying to generate a signed apk but I always get the same error.

To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.

I can´t file that file but I tried modify gradle-wrapper.properties but I still get the same error.

This is my gradle-wrapper.properties file

#Thu May 05 20:51:44 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
org.gradle.jvmargs=-Xmx2048m

I have already try too https://stackoverflow.com/questions/30045417/android-studio-gradle-could-not-reserve-enough-space-for-object-heap

Android Solutions


Solution 1 - Android

Just create a file called gradle.properties in your root project:

root
|--gradle.properties
|--build.gradle
|--settings.gradle
|--app
|----build.gradle

Then add inside the file:

org.gradle.jvmargs=-Xmx2048m

Solution 2 - Android

In the Project window, right click your Project name and choose New > File. The new file name is "gradle.properties". The content is: org.gradle.jvmargs=-Xmx1536M ;(or the number shown in your Gradle Console) in a line like this: ... increase the maximum heap size for the Gradle daemon to more than 2048 MB.

Solution 3 - Android

gradle.properties is located in windows

    C:\Users\<%User_Name%>\.gradle\gradle.properties

In android studio

   `Gradle Scripts` >> `gradle.properties (Global Properties)`

Solution 4 - Android

Just follow the below steps:

> 1)Go to File > 2)Create a New File > 3)Name it as gradle.properties > 4)Write the content in the file > For eg: > org.gradle.jvmargs=-Xmx1536M;(replace it with the numbers in your gradle file)

Hope it helps.

Solution 5 - Android

This is a problem which used to disturb me so much but later on got a quick solution.

I tried the methods mentioned by my colleague but it never worked for me.

Incase the problem persists, use this two ways.

Note Changing the gradle heap size may not assist you so much but you can try this two ways to evade this type of error 'Gradle daemon' error.

Close all other application running and restart the android studio. If the error persist, use the second method.

That is close unnecessary processes running on the background by holding down alt+ctrl and then click del button to open the task manager window.

Mostly, browsers tend to run on the background and consume alot of memory that is why you see that Gradle daemon error.

For example, close chrome process which is running on the background and either restart the android studio or rebuild the project

Solution 6 - Android

I was also finding for the gradle.properties file to enable/disable AOSP Accelerate Clean Builds with Build Cache as explained in the Android Studio user-guide page.

I found the file here through a simple search find -name 'gradle.properties' inside my AOSP root directory

my_AOSP_root/tools/build/gradle.properties

Solution 7 - Android

Keep the gradle.properties in the project folder or in the C:\Users\Username.gradle. Please make sure that the name of file is "gradle.properties", not gradle.properties.txt when saving on windiws using notepad.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRicardoView Question on Stackoverflow
Solution 1 - AndroidGabriele MariottiView Answer on Stackoverflow
Solution 2 - AndroidAryView Answer on Stackoverflow
Solution 3 - AndroidMuhammad AzamView Answer on Stackoverflow
Solution 4 - AndroidChinmaayView Answer on Stackoverflow
Solution 5 - AndroidDaniel NyamasyoView Answer on Stackoverflow
Solution 6 - AndroidYasinduView Answer on Stackoverflow
Solution 7 - AndroidAbhinav SrivastavaView Answer on Stackoverflow