java.lang.OutOfMemoryError on latest AndroidStudio preview version

262 views
Skip to first unread message

Iliya

unread,
May 5, 2017, 3:42:31 PM5/5/17
to adt-dev
Hey all,
Was checking out the latest preview of AS and the new gradle plugins and started getting a Java OOM error when gradle gets to the "transformNativeLibsWithMergeJniLibsForDebug" stage.
I have seen this before but setting up more memory for java in the gradle.properties file fixed it. Now it seems that this is no longer doing the trick.

gradle.properties
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx8704m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
#org.gradle.parallel=true

# When set to true the Gradle daemon is used to run the build. For local developer builds this is our favorite property.
# The developer environment is optimized for speed and feedback so we nearly always run Gradle jobs with the daemon.
org.gradle.daemon=true

# Configuration on demand is an incubation feature of Gradle. When enabler it will make Gradle
# configure everything on demand rather than eagerly.
org.gradle.configureondemand=true

# Android Studio 2.2 Beta 3 introduces a new build cache feature that can speed up build times (including full builds, 
# incremental builds, and instant run) by storing and reusing files/directories that were created in previous builds of 
# the same or different Android project. 
android.enableBuildCache=true

Also tried setting javaMaxHeapSize in the build.gradle file without success:

    dexOptions {
        javaMaxHeapSize "6g"
    }


Iliya

unread,
May 11, 2017, 12:01:42 PM5/11/17
to adt-dev
Found an answer to my question, and figured I'd post here in case anyone else was having the same issue. Apparently it's a reported bug in the 2.4.0 gradle plugin. Bug report here: https://issuetracker.google.com/issues/37636107
Reply all
Reply to author
Forward
0 new messages