在Android Studio 3.0 RC2中编译发布版本时出错 [英] Error while compiling release build in Android Studio 3.0 RC2

查看:814
本文介绍了在Android Studio 3.0 RC2中编译发布版本时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android Studio 3.0 RC2中编译发布版本时,如何解决此问题?
$ b


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



错误:错误:httpclient定义的类与Android提供的类
冲突。解决方案包括查找较新的版本或
替代库,这些库不具有相同的问题(例如,httpclient使用
使用HttpUrlConnection或okhttp),或
使用类似jarjar的工具重新打包库。
[DuplicatePlatformClasses]


我的build.gradle是

  compile'net.zetetic:android-database-sqlcipher:3.5.7@aar'
compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar' ){
transitive = true;
}
编译'com.android.support:appcompat-v7:26.1.0'
编译'com.android.support:support-v4:26.1.0'
编译'com.android.support:cardview-v7:26.1.0'
compile'c​​om.android.support:recyclerview-v7:26.1.0'
compile'c​​om.android.support:design:26.1 .0'
compile'c​​om.android.support:multidex:1.0.2'
编译项目(':rangebar')
编译项目(':expandablerecyclerview')
编译项目(':materialsearchview')
//播放服务
编译'com.google.android.gms:play-services-auth:11.4.2'
编译'com.google.android .gms:play-services-analytics:11.4.2'
compile'c​​om.google.android.gms:play-services-plus:11.4.2'
compile'c​​om.google.android.gms :play-services-maps:11.4.2'
compile'c​​om.google.android.gms:play-services-location:11.4.2'
compile'c​​om.google.android.gms:play -services-places:11.4.2'
compile'c​​om.google.android.gms:play-services-wearable:11.4。 2'
compile'c​​om.google.android.gms:play-services-fitness:11.4.2'
// Firebase
compile'c​​om.google.firebase:firebase-core:11.4 .2'
compile'c​​om.google.firebase:firebase-messaging:11.4.2'
compile'c​​om.google.api-client:google-api-client:1.22.0'
编译'com.google.apis:google-api-services-people:v1-rev66-1.22.0'
//只需GSON
编译'com.google.code.gson:gson:2.8 .0'
//不记得是什么关于

//查看联编程序
编译'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
//社交SDK的
编译'com.facebook.android:facebook-android-sdk:4.20.0'
// Glide libs
编译'com.github.bumptech.glide:glide:3.7.0'
编译'jp.wasabeef:glide-transformations:2.0.1'
// SquareUp库
编译'com.squareup.okio:okio:1.13.0'
compile'c​​om.squareup.retrofit2:retrofit:2.3.0'
compile'c​​om。 squareup.retrofit2:converter-gson:2.3.0'
compile'c​​om.squareup.retrofit2:adapter-rxjava:2.2.0'
compile'c​​om.squareup.okhttp3:logging-interceptor:3.7。 0'
compile'c​​om.squareup.okhttp3:okhttp:3.9.0'
compile'c​​om.squareup.okhttp3:okhttp-urlconnection:3.7.0'
compile'c​​om.google。 dagger:dagger:2.11'
compile'c​​om.google.dagger:dagger-android-support:2.11'
annotationProcessor'com.google.dagger:dagger-compiler:2.11'
compile' com.github.florent37:dagger-auto-inject:1.0.0'
annotationProcessor'com.github.florent37:dagger-auto-inject-compiler:1.0.0'
compile('com.hwangjr .rxbus:rxbus:1.0.5'){
exclude group:'com.jakewharton.timber',module:'timber'
}
compile'c​​om.github.PhilJay:MPAndroidChart: v3.0.1'
//?
编译'it.neokree:MaterialTabs:0.11'
//?
compile'c​​om.getbase:floatingactionbutton:1.10.1'
compile'c​​om.github.castorflex.smoothprogressbar:library:1.1.0'
compile'c​​om.yqritc:recyclerview-flexibledivider: 1.4.0'
compile'c​​om.pnikosis:materialish-progress:1.7'
compile'c​​om.r0adkll:slidableactivity:2.0.5'
compile'c​​om.github.asyl.animation: arcanimator:1.0.0'
compile'c​​om.pacioianu.david:ink-page-indicator:1.2.0'
compile'pl.droidsonroids.gif:android-gif-drawable:1.2.6'
//拾取器的循环适配器
编译'com.mobsandgeeks:adapter-kit:0.5.3'
// RX libs
编译'io.reactivex:rxandroid:1.2。 1'
compile'io.reactivex:rxjava:1.3.0'
compile'c​​om.wdullaer:materialdatetimepicker:3.3.0'
compile'c​​om.github.aakira:expandable-layout: 1.6.0@aar'
编译'com.google.maps.android:android-maps-utils:0.5'
编译'com.mikhaellopez:circularimageview:3.0.2'
// CALENDAR
编译'joda-time:joda- time:2.9.9'
compile'c​​om.googlecode.libphonenumber:libphonenumber:8.3.2'
compile'c​​om.github.deano2390:MaterialShowcaseView:1.1.0'
compile'me。 leolin:ShortcutBadger:1.1.13@aar'
compile'c​​om.prolificinteractive:material-calendarview:1.4.3'
compile'net.time4j:time4j-android:3.29-2017a'
// TODO CHECK
compile'c​​om.github.michael-rapp:android-material-dialog:4.0.1'
compile'c​​om.daimajia.swipelayout:library:1.2.0@aar'
compile'c​​om.jakewharton.rxbinding:rxbinding:1.0.0'
// TODO CHECK
compile'me.zhanghai.android.materialratingbar:library:1.0.2'
compile' com.github.markomilos:paginate:0.5.1'
compile'c​​om.github.jimcoven:jcropimageview:0.22'
compile'ru.egslava:MaskedEditText:1.0.5'
compile' com.github.delight-im:Android-SimpleLocation:v1.0.1'


解决方案 div>

添加到位于应用模块中的build.gradle

 配置{
全部{
排除模块:'httpclient'
排除模块:'commons-logging'
}
}


How can I fix this issues while compiling release build in Android Studio 3.0 RC2

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]

My build.gradle is

compile 'net.zetetic:android-database-sqlcipher:3.5.7@aar'
compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
    transitive = true;
}    
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:multidex:1.0.2'
compile project(':rangebar')
compile project(':expandablerecyclerview')
compile project(':materialsearchview')
// Play Services
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.google.android.gms:play-services-analytics:11.4.2'
compile 'com.google.android.gms:play-services-plus:11.4.2'
compile 'com.google.android.gms:play-services-maps:11.4.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
compile 'com.google.android.gms:play-services-wearable:11.4.2'
compile 'com.google.android.gms:play-services-fitness:11.4.2'
// Firebase
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.apis:google-api-services-people:v1-rev66-1.22.0'
// Just GSON
compile 'com.google.code.gson:gson:2.8.0'
// Don't remember what is it about

// View binder
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
// Social SDK's
compile 'com.facebook.android:facebook-android-sdk:4.20.0'
// Glide libs
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'jp.wasabeef:glide-transformations:2.0.1'
// SquareUp libs
compile 'com.squareup.okio:okio:1.13.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.7.0'
compile 'com.squareup.okhttp3:okhttp:3.9.0'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.7.0'
compile 'com.google.dagger:dagger:2.11'
compile 'com.google.dagger:dagger-android-support:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
compile 'com.github.florent37:dagger-auto-inject:1.0.0'
annotationProcessor 'com.github.florent37:dagger-auto-inject-compiler:1.0.0'
compile('com.hwangjr.rxbus:rxbus:1.0.5') {
    exclude group: 'com.jakewharton.timber', module: 'timber'
}
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
// ?
compile 'it.neokree:MaterialTabs:0.11'
// ?
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
compile 'com.yqritc:recyclerview-flexibledivider:1.4.0'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.r0adkll:slidableactivity:2.0.5'
compile 'com.github.asyl.animation:arcanimator:1.0.0'
compile 'com.pacioianu.david:ink-page-indicator:1.2.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.6'
// Circular adapter for picker
compile 'com.mobsandgeeks:adapter-kit:0.5.3'
// RX libs
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.3.0'
compile 'com.wdullaer:materialdatetimepicker:3.3.0'
compile 'com.github.aakira:expandable-layout:1.6.0@aar'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.mikhaellopez:circularimageview:3.0.2'
//CALENDAR
compile 'joda-time:joda-time:2.9.9'
compile 'com.googlecode.libphonenumber:libphonenumber:8.3.2'
compile 'com.github.deano2390:MaterialShowcaseView:1.1.0'
compile 'me.leolin:ShortcutBadger:1.1.13@aar'
compile 'com.prolificinteractive:material-calendarview:1.4.3'
compile 'net.time4j:time4j-android:3.29-2017a'
// TODO CHECK
compile 'com.github.michael-rapp:android-material-dialog:4.0.1'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'
compile 'com.jakewharton.rxbinding:rxbinding:1.0.0'
// TODO CHECK
compile 'me.zhanghai.android.materialratingbar:library:1.0.2'
compile 'com.github.markomilos:paginate:0.5.1'
compile 'com.github.jimcoven:jcropimageview:0.22'
compile 'ru.egslava:MaskedEditText:1.0.5'
compile 'com.github.delight-im:Android-SimpleLocation:v1.0.1'

解决方案

Add to build.gradle located in app module

configurations {
    all {
        exclude module: 'httpclient'
        exclude module: 'commons-logging'
    }
}

这篇关于在Android Studio 3.0 RC2中编译发布版本时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆