我已将 Android Studio 更新到版本 3,现在似乎无法编译我之前编译的项目而没有错误。
错误信息如下
Error:Error: commons-logging 定义的类与 Android 现在提供的类冲突。解决方案包括查找没有相同问题的较新版本或替代库(例如,对于 httpclient,请改用 HttpUrlConnection 或 okhttp),或使用 jarjar 之类的东西重新打包库。[重复平台类]
依赖项是
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'
}
并且错误似乎是由
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'
我已经使用exclude module: 'httpclient'
了为什么它不编译?这是 Android Studio 3 的错误和\或包含的com.android.tools.build:gradle:3.0.0
插件还是我遗漏了什么?与以前的版本编译完全一样的项目没问题。