2015-04-23 78 views
0

我正在使用Android工作室,我试图将Picasso库添加到我的项目,但每当我尝试运行应用程序时,我遇到此错误毕加索原因执行失败的任务':应用程序:dexDebug'

Error:Execution failed for task ':app:dexDebug'. 
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 

这里是我的Gradle文件

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 22 
buildToolsVersion "22.0.0" 

defaultConfig { 
    applicationId "com.example" 
    minSdkVersion 15 
    targetSdkVersion 22 
    versionCode 1 
    versionName "1.0" 
} 

buildTypes { 
    release { 
     minifyEnabled true 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.android.support:appcompat-v7:22.0.0' 
compile 'com.facebook.android:facebook-android-sdk:3.21.1' 
//TODO::Update to the latest version of Play Service 
compile 'com.google.android.gms:play-services:6.5.87' 
compile 'com.lorentzos.swipecards:library:1.0.8' 
compile 'com.android.support:support-v4:22.0.0' 
compile 'ch.halarious:halarious-core:0.11' 
compile 'com.google.code.gson:gson:2.3.1' 
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3' 
compile 'com.soundcloud.android:android-crop:[email protected]' 
compile 'de.hdodenhof:circleimageview:1.2.2' 
compile 'commons-io:commons-io:2.0.1' 
compile 'com.integralblue:httpresponsecache:1.0.0' 
compile 'com.koushikdutta.ion:ion:2.1.3’ 

//Here is the Picasso compile line 
compile 'com.squareup.picasso:picasso:2.3.3' 
} 

我使用的是最新的JDK版本的Mac “的jdk-8u45-MacOSX的-64”。顺便说一句,我曾尝试这些解决方案(清洁,建设,重启),所以没有必要建议他们

在此先感谢

回答

6

愿你所面对的65K methos限制问题。 https://developer.android.com/tools/building/multidex.html

请把这个在您的默认配置:

default Config { 

    minSdkVersion 14 
    targetSdkVersion 21 

    // Enabling multidex support. 
    multiDexEnabled true 
} 

,然后再试一次

+0

感谢的人。这是65k方法限制问题的作品。 –

+0

通过向Gradle中的默认配置节添加'multiDexEnabled true'来解决 –

相关问题