7/05/2016

dx process limitation (dexOptions is specifying a maximum number of 2 concurrent dx processes, but the Gradle daemon was initialized with 4)

When I enable multidex and executing ./gradlew build command, I meet the problem about 'dx process limitation' when

Error message:

To initialize with a different maximum value, first stop the Gradle daemon by calling ‘gradlew —-stop’.
dexOptions is specifying a maximum number of 2 concurrent dx processes, but the Gradle daemon was initialized with 4.

To fix the problem, I change the maxProcessCount to 1 in my gradle file.



android {

  ...

  dexOptions {

        jumboMode = true // Eabled it to allow a larger number of strings in the dex files

        maxProcessCount 1 // The maximum number of concurrent processes that can be used to dex. Defaults to 4.

        threadCount 1 // Number of threads to use when running dx. Defaults to 4.

        dexInProcess false   //To disable dexing-in-process, add the following code to your module-level build.gradle file:

        preDexLibraries true // Whether to pre-dex libraries. This can improve incremental builds, but clean builds may be slower.

    }

 }

No comments:

Post a Comment