共享一下依赖包:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
// exclude group: 'com.android.support', module: 'support-annotations'
// })
// compile 'com.android.support:appcompat-v7:27.0.2'
// testCompile 'junit:junit:4.12'
compile project(':common')
compile 'com.android.support:cardview-v7:23.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.gyf.barlibrary:barlibrary:2.3.0'
compile 'com.tencent.bugly:crashreport_upgrade:latest.release'
//其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
compile 'com.tencent.bugly:nativecrashreport:latest.release'
//其中latest.release指代最新版本号,也可以指定明确的版本号,例如2.2.0
compile 'com.youzanyun.open.mobile:basic:6.3.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
implementation files('libs/commons-lang3-3.6.jar')
/*友盟统计需要的最新版本组件化基础库和统计SDK*/
// implementation 'com.umeng.sdk:common:latest.integration'
// implementation 'com.umeng.sdk:analytics:latest.integration'
// implementation 'com.umeng.sdk:common:1.4.4'
// implementation 'com.umeng.sdk:analytics:7.4.4'
implementation 'com.android.support:multidex:1.0.3'
compile project(':IMKit')
compile project(':IMLib')
implementation files('libs/MiPush_SDK_Client_3_6_9.jar')
compile 'com.android.support:multidex:1.0.3'
implementation files('libs/fastjson-1.2.5.jar')
//稳定版
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.3'//没有使用特殊Header,可以不加这行
implementation 'com.androidkun:XTabLayout:1.1.3'
implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.1.1'
// implementation 'com.nineoldandroids:library:2.4.0'
// implementation 'com.github.bumptech.glide:glide:4.3.1'
// annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
implementation 'com.android.support:recyclerview-v7:23.1.1'
}
我出现这个问题是因为在添加类似微信发布时进入相册或相机选择图片,同时可以预览与删除操作,在没有加入项目的demo中是完全没有问题的,加入项目中后就出现了各种问题,依赖的冲突。
我的处理方法是:
1.删除冲突的依赖:
compile 'com.android.support:appcompat-v7:27.0.2'
是的,我删除了上面的依赖就可以了,有不少人说可以通过一下的方法解决:
强制统一版本
在你的build.gradle(app module)文件下添加:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.2.0'
}
}
}
}
上述代码中”details.useVersion”后面的版本号,根据自己所使用的版本更改。
我没有这么做,因为我的项目依赖太多,版本也是不相同的,所以觉得不适合我的这个项目,希望适合你的项目