要在进程中运行dex,Gradle守护程序需要更大的堆.当前有910 MB [英] To run dex in process, the Gradle daemon needs a larger heap. It currently has 910 MB
问题描述
实际上,主要错误是"java.exe
使用非零退出值1完成".首先,我告诉您安装Studio后遇到的所有问题:
Actually the main error is "java.exe
finished with non-zero exit value 1". First i tell you every problem which i faced after installing studio:
三天前,我刚刚安装了android studio&我创建了新项目.
Three days ago, i just installed android studio & I created new project.
1)在Google上进行搜索后,首先引发错误插件太旧,请更新到最新版本"
1) First it throw the error "Plugin is too old, please update to more recent version", after searching on google i changed
classpath : com.android.tools.build:gradle:2.0.0-alpha2
到
classpath : com.android.tools.build:gradle:2.0.0-alpha8
当前错误已解决.
2)之后,我要了gradle 2.10
,我也更新了这个&设置路径.
当前错误已解决.
2) After that it was asking for gradle 2.10
, i updated this one also & set the path.
Current Error solved.
3)当我运行我的应用程序时,我又遇到一个错误"app-debug-unaligned.apk
,为属性'input file'指定的不存在".
3) When i ran my application i got one more error "app-debug-unaligned.apk
, specified for property 'input file' does not exist".
我在互联网上搜索了关于stackoverflow的一种解决方案.因此,作为stackoverflow的答案,我转到构建"&我选择了build apk
.
I searched on internet, i got one solution on stackoverflow. So as answer on stackoverflow i go to "Build" & i selected build apk
.
当前错误已解决.
4)但是在那之后我又遇到了一个错误
4) But after that again i got one error
要在进程中运行dex,Gradle守护程序需要更大的堆.它目前有910 MB. 为了加快构建速度,请将Gradle守护程序的最大堆大小增加到1G以上.
"To run dex in process, the Gradle daemon needs a larger heap. It currently has 910 MB. For faster builds, increase the maximum heap size for the Gradle daemon to more than 1G.
java.exe
以非零退出值1结尾.
java.exe
finished with non-zero exit value 1".
最近三天我一直在搜索stackoverflow,我逐个应用了每个答案,但是我无法解决该错误.请救救我,我真的对这个问题感到厌倦.我会向您显示图像确切会出现什么错误
I have been searching on stackoverflow for last three days, i applied each and every answer one by one but i'm not able to solve the error. Please save my life, i am really tired of this problem. I show you image what error is coming exactly
我的build.gradle
文件
apply `plugin: com.android.application`
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "java.danish.org.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
我更新了所有SDK平台和SDk工具.
I updated everything SDK platforms & SDk Tools.
请告诉我我在这里做错了.
Please tell me what i am doing wrong here.
推荐答案
我找到了解决方案.
更改 1)
dexOptions {
javaMaxHeapSize "4g"
}
2)
lintOptions {
checkReleaseBuilds false
abortOnError false
}
这是我的新版build.gradle
,现在一切正常.
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.+'
}
这篇关于要在进程中运行dex,Gradle守护程序需要更大的堆.当前有910 MB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!