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 Android Gradle Could not reserve enough space for object heap
Actually there are 3 places where gradle. properties can be placed: Under gradle user home directory defined by the GRADLE_USER_HOME environment variable, which if not set defaults to USER_HOME/. gradle.
Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.
The Wrapper shell script and batch file reside in the root directory of a single or multi-project Gradle build. You will need to reference the correct path to those files in case you want to execute the build from a subproject directory e.g. ../../gradlew tasks .
You can create this file manually in project root directory, near other ". properties" files.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With