gpt4 book ai didi

android - 多个dex文件定义错误

转载 作者:行者123 更新时间:2023-12-03 06:16:16 25 4
gpt4 key购买 nike

我知道这个问题已经被问过几次了,但是所提供的解决方案都没有对我有用,因此我要提出一个新的解决方案。将项目从Eclipse导入Android Studion后,出现上述错误。以下是我的build.gradle文件。如您所见,我已经评论了大多数我的库,但是仍然没有解决方法。先谢谢您的帮助。

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false

compileOptions {
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
defaultConfig {
applicationId "com.xxx.yyy"
minSdkVersion 14
targetSdkVersion 22
}

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

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.http-client:google-http-client-gson:1.20.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.google.guava:guava:18.0'
compile 'joda-time:joda-time:2.7'
//compile files('libs/google-api-client-1.19.1.jar')
//compile files('libs/google-api-client-android-1.19.1.jar')
compile files('libs/google-api-services-youtube-v3-rev126-1.19.1.jar')
//compile files('libs/google-http-client-1.19.0.jar')
//compile files('libs/google-http-client-android-1.19.0.jar')
//compile files('libs/google-http-client-jackson2-1.17.0-rc.jar')
compile files('libs/google-oauth-client-1.17.0-rc.jar')
//compile files('libs/google-oauth-client-java6-1.17.0-rc.jar')
//compile files('libs/google-oauth-client-jetty-1.17.0-rc.jar')
//compile files('libs/google-oauth-client-servlet-1.17.0-rc.jar')
compile files('libs/jackson-core-2.1.3.jar')
//compile files('libs/Parse-1.9.1.jar')
compile 'com.parse.bolts:bolts-android:1.1.2'
compile files('libs/picasso-2.3.4.jar')
compile files('libs/twitter4j-core-4.0.2.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile 'com.android.support:appcompat-v7:22.1.1'
compile project(':CircularImageView')
//compile files('libs/google-play-services.jar')
compile 'com.google.android.gms:play-services-base:7.3.0'
//compile 'com.google.android.gms:play-services-plus:7.3.0'
compile project(':CountryPicker')
compile project(':PullToRefreshListView')
compile('com.facebook.android:facebook-android-sdk:3.22.0@aar') {
exclude module: 'support-v4'
exclude module: 'bolts'
}
}

我遇到的错误:
com.android.dex.DexException: Multiple dex files define Lcom/google/api/client/util/StreamingContent

最佳答案

感谢@Gabriele的指导。我通过删除google-api-client-1.19.1.jar解决了这个问题,事实证明,尽管它已被注释掉,但它仍然存在于libs文件夹中,因此我不得不手动将其从项目中删除。我从AS终端运行gradle -dependencies时就知道这一点。

关于android - 多个dex文件定义错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30402485/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com