这是我的 build.gradle 文件。
任何帮助都将不胜感激。 谢谢。
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.squad.run"
minSdkVersion 10
targetSdkVersion 19
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':facebookSDK')
compile project(':library')
compile project(':progressHUD_Squadrun')
compile project(':pullToRefreshLibrary_Squadrun')
compile project(':slidingMenuLibrary_SquadRun')
compile project(':viewPagerIndicator_Squadrun')
compile 'com.android.support:support-v4:20.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services:+'
compile ('com.android.support:appcompat-v7:+')
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'org.apache.httpcomponents:httpmime:4.2.3'
compile 'com.squareup.okhttp:okhttp:1.5.4'
compile 'oauth.signpost:signpost-commonshttp4:1.2.1.2'
compile 'org.twitter4j:twitter4j-core:4.0.1'
compile files('libs/FlurryAnalytics-4.1.0.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:20.+'
force 'com.android.support:appcompat-v7:20.+'
}
}
The error i am getting is:
Error:Execution failed for task ':splashActivity:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Program Files (x86)\Android\android-studio\sdk\build-tools\android-4.4W\dx.bat --dex --num-threads=4 --output C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\dex\debug C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\classes\debug C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\dependency-cache\debug C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\bolts-a453c67e9fbcb8b2df66a807f07597b525fb5510.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-0995d8d31789d692af9771bc79994535d0e9a11a.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-82cb9af78535d442f7254cfacf8e5581ec7f198f.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-89329bbc6b94e906573340292603af66cd64cb4e.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-9ae85e5dda6ac87e5fea9eef10579046127f64ec.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-9e0a0926f1bf743e60be55256fecd3044b3fb3a3.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-db2d588e091d9f00bcf352380664bcea0550c2db.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-e47e7de01366f4c982a9621611d5b51065b46b4c.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-e5a017caf8243b588c7668187fffdb443d97efa3.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\classes-edb407f320a9d16ab253cdece9f7de0c9849dee4.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\commons-codec-1.3-744613167a0498e87bddefe11d9715a6a77d814c.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\FlurryAnalytics-4.1.0-3e22e246a0fe5113ab006ccb53afd17722686ba5.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\gson-2.2.4-09611e369a15fd5115f540570c544bb969143206.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\httpcore-4.2.2-6d4bd90cc9c601d0cb426d3b6f13e630051be2ab.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\httpmime-4.2.3-114981e5b1ca0603b19d0c173b834fb4f36dc7b3.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\internal_impl-20.0.0-4d4a1b5904ea596662a1d75090720f4a71528c3c.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\nineoldandroids-2.4.0-c15291f1a5d73b9ed06c48806c179c177c2c9326.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\okhttp-1.5.4-1d4d39f1325704b750ebee0aa6d60f57eca82163.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\picasso-2.3.4-825d3c0d5a3645c39e62902f73d0b2e5dbc2f221.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\retrofit-1.6.1-7a2bce6e9943b126155a7444b7c6abd4fb80e2cb.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\signpost-commonshttp4-1.2.1.2-457264617652896d5137504440ed9fd54533c9c3.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\signpost-core-1.2.1.2-114c53ef70d732d013001aa342ae8e81962fb26c.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\signpost-core-1.2.1.2-4824b5b475ceb675ff2174e6d7caf3756ba2af4a.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\support-annotations-20.0.0-79e42da7c2657068d681cf877be8b4cc06e3cb7a.jar C:\Users\Jonty\Documents\Studio\squadrunapp_duplicate\splashActivity\build\intermediates\pre-dexed\debug\twitter4j-core-4.0.1-1e2ff826eb1ee2df67db1f0634f99a7220b788a7.jar
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/gdata/util/common/base/Escaper;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
从我现在读到的内容来看,我认为错误是由V4库和V7库之间的冲突引起的。但是我该如何解决呢?我也尝试了排除V4库,但仍然没有运气。我导入的项目也使用V4库,并且在它们的依赖项中有V4库。
dependencies {
compile 'com.android.support:support-v4:20.0.0'
}
任何帮助都将不胜感激。 谢谢。