添加了java Fragment文件后。
nim-demo/demo/build.gradle 文件就被Studio添加了
implementation 'com.android.support:support-v4:28.0.0-alpha3'
编译就报
Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]
F:\Android\...\demo\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read[C:\Users\[user]\.gradle\caches\transforms-1\files-1.1\coordinatorlayout-28.0.0-alpha3.aar\295c594f869ef17f3bbea1e8336c45af\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]))
原工程是api 26的。
工程目录build.gradle
nim-demo/build.gradel
buildscript {
apply from: 'script.gradle', to: buildscript
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {url 'http://developer.huawei.com/repo'}
maven { url 'https://fabric-artifacts.s3.amazonaws.com/public' }
}
}
ext {
compileSdkVersion = 28
buildToolsVersion = '28.0.0'
minSdkVersion = 14
targetSdkVersion = 28
appTargetSdkVersion = 28
versionCode = 49
versionName = '5.2.0'
sdkSourceCompatibility = 1.7
sdkTargetCompatibility = 1.7
appSourceCompatibility = 1.7
appTargetCompatibility = 1.7
}
nim-demo/demo/build.gradle
buildscript {
repositories {
maven { url 'https://fabric-artifacts.s3.amazonaws.com/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
def static getGitVersion() {
try {
return 'git rev-parse --short HEAD'.execute().text.trim()
} catch (Throwable th) {
th.printStackTrace()
return ""
}
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.appTargetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
buildConfigField "String", "GIT_REVISION", "\"${getGitVersion()}\""
buildConfigField "String", "BUILD_DATE", "\"${new Date().toLocaleString()}\""
multiDexEnabled true
ndk {
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
}
}
signingConfigs {
debug { storeFile file("debug.keystore") }
release {
storeFile file('release.keystore')
storePassword 'thisiskeystorepassword'
keyAlias 'nim_demo'
keyPassword 'thisiskeypassword'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
manifestPlaceholders = [AMAP_KEY: "09fd4efd3e28e9bf1f449ecec7d34bfe"]
ext.enableCrashlytics = false
}
release {
shrinkResources true
minifyEnabled true
zipAlignEnabled true
proguardFile('proguard.cfg')
signingConfig signingConfigs.release
manifestPlaceholders = [AMAP_KEY: "ee20324fba1c7f4ad7a4a207e7f08e8d"]
ext.enableCrashlytics = true
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res', 'res-chatroom', 'res-rp']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs', 'libs-sdk']
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
dexOptions {
preDexLibraries false
jumboMode true
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
aaptOptions {
cruncherEnabled = false
useNewCruncher = false
}
flavorDimensions "rc"
compileOptions {
sourceCompatibility rootProject.ext.appSourceCompatibility
targetCompatibility rootProject.ext.appTargetCompatibility
}
}
dependencies {
implementation 'com.android.support:multidex:1.0.2'
implementation fileTree(include: '*.jar', dir: 'libs')
implementation project(path: ':uikit')
implementation project(':jrmfRpWalletlib')
implementation project(':avchatkit')
//debugImplementation project(':plugins:sf')
implementation 'com.google.firebase:firebase-messaging:11.6.0'
implementation 'com.google.android.gms:play-services-base:11.6.0'
implementation 'com.meizu.flyme.internet:push-internal:3.6.3@aar'
implementation 'com.huawei.android.hms:push:2.6.0.301'
implementation 'com.netease.nimlib:jsbridge:1.3.1'
compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
transitive = true
}
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:1.1.0"
// Java8 support for Lifecycles
implementation "android.arch.lifecycle:common-java8:1.1.0"
compile project(path: ':rtskit')
}
apply plugin: 'com.google.gms.google-services'