':应用程序:transformClassesWithDexForDebug'。 > com.android.build.transform.api.TransformException:当我在我的工作室项目中添加了Facebook最新的SDK [英] ':app:transformClassesWithDexForDebug'. > com.android.build.transform.api.TransformException: when i added Facebook latest SDK in my studio project
问题描述
//编译'com。 facebook.android:facebook-android-sdk:4.7.0'
这是我的android studio项目结构我的主要App文件夹毕业有以下图书馆。
compile fileTree(include:['* .jar'],dir:'libs '
编译项目(':twitter-core-release')
编译项目(':tweet-ui-release')
编译项目(':twitter-release ')
编译项目(':tweet-composer-release')
//编译'com.facebook.android:facebook-android-sdk:4.7.0'
编译项目(' :
编译'com.android.support:appcompat-v7:23.0.1'
编译'com.android.support:design:23.0.1'
compile'com。 squareup.retrofit:retrofit:2.0.0-beta1'
compile'com.squareup.retrofit:converter-jackson:2.0.0-beta1'
compile'c om.squareup.retrofit:adapter-rxjava:2.0.0-beta1'
compile'com.twotoasters.jazzylistview:library:1.2.1'
compile'com.twotoasters.jazzylistview:library-recyclinglerview: 1.2.1'
compile'com.pnikosis:kindish-progress:1.7'
compile'com.google.android.gms:play-services-gcm:8.1.0'
compile' com.android.support:recyclerview-v7:23.0.1'
compile'io.realm:realm-android:0.82.2'
compile'com.google.android.gms:play-services-分析:8.1.0'
compile'jp.wasabeef:recyclelerview-animators:1.3.0'
compile'com.google.code.gson:gson:2.3'
compile'io。 ()。 p $ p>
在我的应用程序库中,它具有universal-image-loader-1.9.4.jar
和在facebook_sk它有以下
依赖关系{
compile fileTree(include:['* .jar ],dir:'libs')
testCompile'junit:junit:4.12'
// compile'com.android.support:appcompat-v7:23.0.1'
compile'com。 android.support:support-v4:23.0.1'
}
在Facebook的libs有螺栓 - android-1.1.2.jar
如果我删除了facebook skd并构建我的项目,那么它在工作室中运行良好,但是当我不能Facebook sdk然后它给我以下错误:
错误:执行失败的任务':app:transformClassesWithDexForDebug'。
> com.android.build.transform.api.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'/Library/Java/JavaVirtualMachines/jdk1.8.0_51。 jdk / Contents / Home / bin / java完成了非零退出值2
需要使用multidex?
解决方案现在我通过添加multidex
解决了问题 defaultConfig {
applicationIdcom.xxxxx
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName1.0
//启用多重支持。
multiDexEnabled true
}
依赖关系{
编译fileTree(包括:['* .jar'],dir:'libs')
编译项目(':twitter-core-release')
编译项目(':tweet-ui-release')
编译项目(':twitter-release')
编译项目(':tweet-composer-release')
//编译'com.facebook.android:facebook-android-sdk:4.7.0'
编译项目(':facebook_sk')
编译'com.squareup.retrofit:retrofit:2.0.0-beta1'
compile'com.squareup.retrofit:converter-jackson:2.0.0-beta1'
compile'com.squareup.retrofit: adapter-rxjava:2.0.0-beta1'
compile'com.twotoasters.jazzylistview:library:1.2.1'
compile'com.twotoasters.jazzylistview:library-recyclinglerview:1.2.1'
compile'com.pnikosis:kindish-progress:1.7'
compile'com.google.android.gms:play-services-gcm:8.1.0'
compile'com.google.android .gms:play-services-analytics:8.1.0'
compile'io.realm:realm-android:0.82.2'
compile'jp.wasabeef:recyclelerview-animators:1.3.0'
编译'com.google.code.gson:gson:2.3'
compile'io.fabric.sdk.android:fabric:1.3.+@aar'
compile'com.digits.sdk .android:digits:1.7。+ @ aar'
compile'com.android.support:multidex:1.0.1'
}
而对于Facebook sdk:
依赖关系{
compile fileTree (包括:['* .jar'],dir:'libs')
testCompile'junit:junit:4.12'
// compile'com.android.support:appcompat-v7:23.0.1 '
compile'com.android.support:support-v4:23.0.1'
compile'com.android.support:appcompat-v7:23.0.1'
compile'com.android .support:design:23.0.1'
compile'com.android.support:recyclerview-v7:23.0.1'
}
I am getting error when i try to add Facebook as a library or as a gradle
//compile 'com.facebook.android:facebook-android-sdk:4.7.0'
Here is my android studio project structure my main App folder gradle have following library .
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':twitter-core-release')
compile project(':tweet-ui-release')
compile project(':twitter-release')
compile project(':tweet-composer-release')
//compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile project(':facebook_sk')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta1'
compile 'com.squareup.retrofit:converter-jackson:2.0.0-beta1'
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1'
compile 'com.twotoasters.jazzylistview:library:1.2.1'
compile 'com.twotoasters.jazzylistview:library-recyclerview:1.2.1'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'io.realm:realm-android:0.82.2'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'jp.wasabeef:recyclerview-animators:1.3.0'
compile 'com.google.code.gson:gson:2.3'
compile 'io.fabric.sdk.android:fabric:1.3.+@aar'
compile 'com.digits.sdk.android:digits:1.7.+@aar'
in my app libs it have universal-image-loader-1.9.4.jar
and in facebook_sk it have following
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
//compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
}
in facebook libs it have bolts-android-1.1.2.jar
if i removed facebook skd and build my project then it running fine in studio but when i unable facebook sdk then it give me following error :
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Do i need to use multidex ?
解决方案 For now i resolved issue by adding multidex
defaultConfig {
applicationId "com.xxxxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':twitter-core-release')
compile project(':tweet-ui-release')
compile project(':twitter-release')
compile project(':tweet-composer-release')
//compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile project(':facebook_sk')
compile 'com.squareup.retrofit:retrofit:2.0.0-beta1'
compile 'com.squareup.retrofit:converter-jackson:2.0.0-beta1'
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1'
compile 'com.twotoasters.jazzylistview:library:1.2.1'
compile 'com.twotoasters.jazzylistview:library-recyclerview:1.2.1'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'io.realm:realm-android:0.82.2'
compile 'jp.wasabeef:recyclerview-animators:1.3.0'
compile 'com.google.code.gson:gson:2.3'
compile 'io.fabric.sdk.android:fabric:1.3.+@aar'
compile 'com.digits.sdk.android:digits:1.7.+@aar'
compile 'com.android.support:multidex:1.0.1'
}
And for Facebook sdk :
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
//compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
}
这篇关于':应用程序:transformClassesWithDexForDebug'。 > com.android.build.transform.api.TransformException:当我在我的工作室项目中添加了Facebook最新的SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!