Android的工作室 - 在问题未捕获的build.gradle平移误差为ExecutionException内存不足 [英] Android Studio - Issue in build.gradle uncaught translation error ExecutionException OutOfMemory

查看:2963
本文介绍了Android的工作室 - 在问题未捕获的build.gradle平移误差为ExecutionException内存不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的Andr​​oid Studio中Android应用程序一个奇怪的问题。一切似乎都加入了一些的新文件后,工作正常,直到今天的和进行一些更新的的build.gradle

我看到错误消息是以下内容:

 未捕获的翻译错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:GC开销超过限制
未捕获的翻译错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:超出GC开销限制
未捕获的翻译错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:超出GC开销限制
未捕获的翻译错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:超出GC开销限制
未捕获的翻译错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:超出GC开销限制
未捕获的翻译错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:超出GC开销限制
6个错误;中止
错误:执行失败的任务:为MyApplication:dexDebug。
> com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:过程'命令'C:\\ Program Files文件\\的Java \\ jdk1.8.0_11 \\斌\\ java.exe的''与非完零退出值1

你知道,如果有低于我的build.gradle什么问​​题?新线正在补充说:低于此行 新的依赖。我还设置multiDexEnabled为true。

 应用插件:'com.android.application
安卓{
    compileSdkVersion 23
    buildToolsVersion '23 .0.1
    useLibraryorg.apache.http.legacy    defaultConfig {
        的applicationIDcom.my.app
        14的minSdkVersion
        targetSdkVersion 21
        multiDexEnabled真
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }
    buildTypes {
        发布 {
            minifyEnabled假
            proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard的-rules.txt
        }
    }
    // useLibraryorg.apache.http.legacy
}依赖{
    编译文件(库/ aspectjrt-1.8.2.jar')
    编译文件(库/ isoparser-1.0-RC-27.jar')
    编译文件(库/多屏,Android的1.1.11.jar')
    编译文件(库/毕加索-2.5.2.jar')
    编译文件(库/ volley.jar')
    编译com.facebook.android:facebook-android-sdk:4.5.0
    编译com.android.support:appcompat-v7:23.0.1
    编译com.android.support:support-v13:+    / *新的依赖低于此线* /
    编译com.android.support:design:23.0.1
    编译com.android.support:cardview-v7:23.1.0
    编译com.github.bumptech.glide:滑翔:3.6.0
    编译de.hdodenhof:circleimageview:1.3.0    //用于优化列表视图渲染
    //编译com.android.support:recyclerview-v7:23.1.0
    编译uk.co.chrisjenx:书法:2.1.0
    //编译com.squareup.picasso:毕加索:2.5.2    编译com.google.android.gms:播放服务:7.8.0
    //编译com.mcxiaoke.volley:库AAR:1.0.0
    编译com.google.android.gms:发挥服务加:7.8.0
    编译com.google.android.gms:播放服务钱包:7.8.0
}


解决方案

尝试运行使用该选项你的脚本在你的Andr​​oid封:

  dexOptions {
    javaMaxHeapSize4G
}

这将增加DEX操作的最大堆大小。你可以找到在这一番解释 SO质疑

I am having a strange problem with my Android app in Android Studio. Everything seemed to be working fine, until today after adding some new files and making some updates to build.gradle.

The error message I am seeing is the following:

Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
6 errors; aborting
Error:Execution failed for task ':myapplication:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_11\bin\java.exe'' finished with non-zero exit value 1

Do you know if there is any issue with my build.gradle below? The new lines are under "NEW DEPENDENCIES ADDED BELOW THIS LINE". I also set multiDexEnabled to true.

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'
    useLibrary  'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.my.app"
        minSdkVersion 14
        targetSdkVersion 21
        multiDexEnabled true
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    //useLibrary  'org.apache.http.legacy'
}

dependencies {
    compile files('libs/aspectjrt-1.8.2.jar')
    compile files('libs/isoparser-1.0-RC-27.jar')
    compile files('libs/multiscreen-android-1.1.11.jar')
    compile files('libs/picasso-2.5.2.jar')
    compile files('libs/volley.jar')
    compile 'com.facebook.android:facebook-android-sdk:4.5.0'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:support-v13:+'

    /* NEW DEPENDENCIES BELOW THIS LINE */
    compile 'com.android.support:design:23.0.1' 
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'

    // Used to optimize rendering of list views
    // compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'uk.co.chrisjenx:calligraphy:2.1.0'
    //compile 'com.squareup.picasso:picasso:2.5.2'

    compile 'com.google.android.gms:play-services:7.8.0' 
    //compile 'com.mcxiaoke.volley:library-aar:1.0.0' 
    compile 'com.google.android.gms:play-services-plus:7.8.0'
    compile 'com.google.android.gms:play-services-wallet:7.8.0'
}

解决方案

Try to run your script with this option in your android closure:

dexOptions {
    javaMaxHeapSize "4g"
}

This will increase the maximum heap size for dex operations. You can find some explanation in this SO question

这篇关于Android的工作室 - 在问题未捕获的build.gradle平移误差为ExecutionException内存不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆