获取错误:
Error:Error: commons-logging defines classes that conflict with
classes now provided by Android. Solutions include finding newer
versions or alternative libraries that don’t have the same problem
(for example, for httpclient use HttpUrlConnection or okhttp instead),
or repackaging the library using something like jarjar.
[DuplicatePlatformClasses]
Error:Error: httpclient defines classes that conflict with classes now
provided by Android. Solutions include finding newer versions or
alternative libraries that don’t have the same problem (for example,
for httpclient use HttpUrlConnection or okhttp instead), or
repackaging the library using something like jarjar.
[DuplicatePlatformClasses]
已经尝试过该解决方案,它无法正常工作:
configurations {
all {
exclude group: 'org.json', module: 'json'
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}
通过这些更改,无法接收http和套接字响应。在更新android studio之前,构建似乎没问题。
的build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services-location:9.8.0'
compile 'com.google.android.gms:play-services-gcm:9.8.0'
compile 'com.google.android.gms:play-services-vision:9.8.0'
compile 'com.android.support:palette-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'io.socket:socket.io-client:0.8.3'
compile 'com.squareup:otto:1.3.5'
compile 'me.gujun.android.taggroup:library:1.4@aar'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'jp.wasabeef:recyclerview-animators:1.2.0@aar'
compile "com.mixpanel.android:mixpanel-android:4.6.0"
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'
compile 'com.android.support:design:23.1.1'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'org.mongodb:bson:3.0.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:multidex:1.0.1'
//compile 'jp.wasabeef:glide-transformations:2.0.0'
compile 'com.embedly:embedly-api:0.1.5'
compile 'com.facebook.fresco:fresco:0.9.0'
compile 'io.branch.sdk.android:library:1.+'
compile 'com.android.support:customtabs:23.3.0' // Chrome Tab matching
compile 'com.google.android.gms:play-services-ads:9.8.0' // GAID matching
compile 'com.google.android.gms:play-services-appindexing:9.8.0' // App indexing
compile 'com.flaviofaria:kenburnsview:1.0.7'
compile 'ca.barrenechea.header-decor:header-decor:0.2.6'
compile 'org.solovyev.android.views:linear-layout-manager:0.5@aar'
compile group: 'ru.noties', name: 'scrollable', version: '1.2.0'
compile 'com.android.support:palette-v7:23.1.1'
compile "com.daimajia.swipelayout:library:1.2.0@aar"
compile 'com.flurry.android:analytics:7.0.0@aar'
compile 'com.google.android.gms:play-services-analytics:9.8.0'
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
compile 'com.google.zxing:core:3.2.1'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}