相关疑难解决方法(0)

commons-logging定义了与Android Studio Update之后Android现在提供的类冲突的类

我已将Android Studio更新为版本3,现在似乎无法编译我之前编译的项目而没有错误.

错误消息如下

错误:错误:commons-logging定义与Android现在提供的类冲突的类.解决方案包括查找没有相同问题的更新版本或替代库(例如,对于httpclient使用HttpUrlConnection或okhttp),或者使用jarjar之类的东西重新打包库.[DuplicatePlatformClasses]

依赖是

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:27.0.0'
    compile 'com.android.support:design:27.0.0'
    compile 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient'
    compile 'com.google.http-client:google-http-client-gson:1.23.0' exclude module: 'httpclient'
    compile 'com.google.firebase:firebase-core:11.4.2'
}
Run Code Online (Sandbox Code Playgroud)

和错误似乎是由

compile 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient'
compile 'com.google.http-client:google-http-client-gson:1.23.0' exclude module: 'httpclient'
Run Code Online (Sandbox Code Playgroud)

我已经使用了exclude module: 'httpclient' 为什么它不编译?这是Android Studio 3和\或包含com.android.tools.build:gradle:3.0.0插件的错误还是我遗漏了什么?使用以前的版本编译完全相同的项目没有问题.

android android-studio android-gradle-plugin android-studio-3.0 android-gradle-3.0

47
推荐指数
5
解决办法
2万
查看次数