我正在使用Android工作室而我正在尝试将Picasso库添加到我的项目中,但每当我尝试运行该应用时,我都会遇到此错误
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:0.9.10@aar'
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 for Mac“jdk-8u45-macosx-x64”。顺便说一下,我已经尝试过那些解决方案(清理,构建,重启),所以不需要建议它们
提前致谢
答案 0 :(得分:6)
您可能面临65k方法限制问题。 https://developer.android.com/tools/building/multidex.html
请将其放入默认配置中:
default Config {
minSdkVersion 14
targetSdkVersion 21
// Enabling multidex support.
multiDexEnabled true
}
再试一次