To run dex in process, the Gradle daemon needs a larger heap. It currently has approximately 1024 MB
Set org.gradle.jvmargs=-Xmx2048M
in the project gradle.properties
. For more information see https://docs.gradle.org/current/userguide/build_environment.html
You can also add this line in your build.gradle
android {
dexOptions {
javaMaxHeapSize "4g"
}
}
To run dex in process, the Gradle daemon needs a larger heap. It currently has 910 MB
I found the solution.
Changes
1)
dexOptions {
javaMaxHeapSize "4g"
}
2)
lintOptions {
checkReleaseBuilds false
abortOnError false
}
This is my new build.gradle
and everything is working fine now.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0 rc4"
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.aquasoft.guesp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.android.support:design:23.4.0'
compile 'com.stripe:stripe-android:+'
compile 'com.roomorama:caldroid:3.0.1'
compile 'com.android.support:cardview-v7:23.3.+'
}
jvmargs=-xmx2048m dex in process for cordova
Qiong
You nee to put a file named build-extras.gradle
in your platforms/android
folder. Cordova will read the file automatically and will load the configuration for you.
You can do this manually or by a hook. The problem of the first option is that if you erase your platform folder, the will be erased as well.
The content of the file specifies the maximum heap size:
android {
dexOptions {
javaMaxHeapSize "2048m"
}
}
If you want to go with the hook option, the content of the should be like this:
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var rootdir = process.argv[2];
if(fs.existsSync(rootdir + '/platforms/android')){
console.log('Add build-extras.gradle');
fs.createReadStream(rootdir + '/build-extras.gradle').pipe(fs.createWriteStream(rootdir + '/platforms/android/build-extras.gradle'));
}
And you need to put the file on hooks/after_prepare/
folder. This will run your hook automatically.
Related Topics
Uninstall App Silently with System Privileges
Constraintlayout Chains and Text Ellipsis + Image on The Right
Android - Reduce Image File Size
How to Enable Autostart Option for My App in Xiaomi Phone Security App Programmatically in Android
Android, How to Exec a SQL File in Sqlitedatabase
Fragment Standard Transition Not Animating
How to Add a Custom Item to a Navigationview with a Menu Layout
Recyclerview Adapter and Glide - Same Image Every 4-5 Rows
How to Replace a String for a Buildvariant with Gradle in Android Studio
Bitmapfactory.Decodestream Out of Memory Despite Using Reduced Sample Size
Access Ordered Images and Video in Same Cursor
Change Progressbar Color Through Code Only in Android
User Does Not Have Permission to Access This Object . Firebase Storage Android
How to Use The Limit Argument in an Sqlite Query with Android
How to Show Alphabetical Letters on Side of Android Listview