Android Studio Gradle错误:使用Ion koush lib执行任务':app:dexDebug'的执行失败 [英] Android Studio Gradle Error:Execution failed for task ':app:dexDebug' using Ion koush lib

查看:93
本文介绍了Android Studio Gradle错误:使用Ion koush lib执行任务':app:dexDebug'的执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android Studio中使用koush的离子库.但是,当我同步gradle文件中的库并尝试运行该应用程序后,就会发生奇怪的错误.

I want to use the Ion Lib from koush in Android Studio. But after I synchronize the libraries in my gradle file and try to run the application a strange error occurs.

我的想法是,离子库不接受我的gradle文件中的其他库.

My thought is that the Ion Lib does not accept the other libraries in my gradle file.

Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet902Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage902Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon902Library UP-TO-DATE
:app:prepareComKoushikduttaAsyncAndroidasync218Library UP-TO-DATE
:app:prepareComKoushikduttaIonIon218Library UP-TO-DATE
:app:prepareComRengwuxianMaterialedittextLibrary214Library UP-TO-DATE
:app:prepareComSpecyciResidemenu16Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:packageAllDebugClassesForMultiDex UP-TO-DATE
:app:shrinkDebugMultiDexComponents UP-TO-DATE
:app:createDebugMainDexClassList UP-TO-DATE
:app:dexDebug
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 ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_51\bin\java.exe'' finished with non-zero exit value 1
Information:BUILD FAILED

我的Gradle文件:

My Gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "sample.test.soft"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services:9.0.2'
    compile 'com.rengwuxian.materialedittext:library:2.1.4'
    compile 'com.specyci:residemenu:1.6+'
    compile 'com.koushikdutta.ion:ion:2.1.8'
    compile 'com.koushikdutta.async:androidasync:2.1.8'
}

在我的gradle文件中,我用版本号替换了ion和androidasync的"+".

In my gradle file I replaced the '+' of ion and androidasync with the version numbers.

推荐答案

首先使用

编译'com.android.support:multidex:1.0.1'

compile 'com.android.support:multidex:1.0.1'

编译'com.google.android.gms:play-services:+'

compile 'com.google.android.gms:play-services:+'

在您的 AndroidManifest.xml 中添加以下行 android:name

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:name="android.support.multidex.MultiDexApplication"
    >

然后在您的 build.gradle 中添加

dexOptions {
    //incremental = true;
    preDexLibraries = false
    javaMaxHeapSize "4g"
}

这篇关于Android Studio Gradle错误:使用Ion koush lib执行任务':app:dexDebug'的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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