Closed keanbin01 closed 6 years ago
试试 https://github.com/QMUI/QMUI_Android/wiki/QMUI-Q-&-A 第二点。有可能是依赖包冲突
不行,还是有问题: Warning: Exception while processing task java.io.IOException: Can't write [/Users/keanbin/work/workspace/android/imChat-Android/app/build/intermediates/transforms/proguard/release/0.jar] (Can't read [/Users/keanbin/.gradle/caches/transforms-1/files-1.1/support-core-ui-27.1.1.aar/c16384a90426ae7f2bcd2f5432d86759/jars/classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$1.class]))
我添加了: configurations.all { resolutionStrategy { force "com.android.support:recyclerview-v7:${versions.support}" force "com.android.support:appcompat-v7:${versions.support}" force "com.android.support:design:${versions.support}" force "com.android.support:support-vector-drawable:${versions.support}" } } versions.support = "27.1.1"
我的整个gradle 配置: apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt'
// framework module: 最基础的开发框架 层,包含网络、图片显示等等,和具体的项目业务逻辑无关,基本所有的项目都需要。
android { compileSdkVersion versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "boolean", "DEBUG_LOG", config.debug_log_switch
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "HOST", config.hosts.http_release
}
debug {
buildConfigField "String", "HOST", config.hosts.http_debug
}
}
dataBinding {
enabled = true
}
}
configurations.all { resolutionStrategy { force "com.android.support:recyclerview-v7:${versions.support}" force "com.android.support:appcompat-v7:${versions.support}" force "com.android.support:design:${versions.support}" force "com.android.support:support-vector-drawable:${versions.support}" } }
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// kotlin
api "org.jetbrains.kotlin:kotlin-stdlib-jre7:${versions.kotlin}"
api "org.jetbrains.kotlin:kotlin-reflect:${versions.kotlin}"
// support
api "com.android.support:appcompat-v7:${versions.support}"
api 'com.android.support.constraint:constraint-layout:1.0.2'
// okhttp3
api 'com.squareup.okhttp3:okhttp:3.10.0'
api 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
api 'com.squareup.okhttp3:logging-interceptor:3.10.0'
// retrofit2
api 'com.squareup.retrofit2:retrofit:2.4.0'
api 'com.squareup.retrofit2:converter-gson:2.4.0'
api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
// picasso
api 'com.squareup.picasso:picasso:2.71828'
// lifecycle and ViewModel and LiveData
api 'android.arch.lifecycle:extensions:1.1.1'
kapt 'android.arch.lifecycle:compiler:1.1.1'
api "android.arch.lifecycle:reactivestreams:1.1.1"
// room
api "android.arch.persistence.room:runtime:1.0.0"
kapt "android.arch.persistence.room:compiler:1.0.0"
// paging
api 'android.arch.paging:runtime:1.0.0-beta1'
// gson
api 'com.google.code.gson:gson:2.8.2'
// dragger2
api 'com.google.dagger:dagger:2.10'
kapt 'com.google.dagger:dagger-compiler:2.10'
// rxjava2
api 'io.reactivex.rxjava2:rxkotlin:2.2.0'
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
// qmui
api('com.qmuiteam:qmui:1.0.6')
// 字母索引列表控件
api 'com.bigkoo:quicksidebar:1.0.3'
}
问题解决了,只要添加上 api "com.android.support:design:${versions.support}" 就可以了,应该是以这个去覆盖了低于该版本的design库
运行环境
Nexus 6
Android 5.0
2.3.0
1.x.x
具体问题描述
支持的版本是 support : "27.1.1"
debug 时编译出错: AGPBI: {"kind":"error","text":"Program type already present: android.support.design.widget.CoordinatorLayout$1","sources":[{}],"tool":"D8"}
问题截图
异常日志(堆栈)