求助:集成easeUI时报already added: Landroid/support/annotation/ColorRes;
初次使用环信,在AndroidStudio中新建一空白项目,将easeUI以module的形式引入,构建没问题,单一运行重新构建时就报错:
自己工程的build.gradle:
求环信各位大神指教,感激不尽。。。。
UNEXPECTED TOP-LEVEL EXCEPTION:既然说重复引入了v4包,难道我要将easeUI的lib下的supportV4删除么?删了的话,easeUI直接报错,找不到相关v4资源;
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
FAILED
FAILURE: Build failed with an exception.
自己工程的build.gradle:
apply plugin: 'com.android.application'easeUI的build.gradle:
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "austin.com.huanxintest"
minSdkVersion 14
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
// compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile project(':easeui')
}
apply plugin: 'com.android.library'另外,minifest.xml 和 BaseApplication已经按照文档做了集成修改。
android {
compileSdkVersion 19
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 20
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src//... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
//release时需要把easemobchatsdk的依赖注释掉,sdk已经被打成jar包放在libs底下
//compile project(':hyphenatechatsdk')
compile fileTree(dir: 'libs', include: '*.jar')
}
求环信各位大神指教,感激不尽。。。。
没有找到相关结果
已邀请:
3 个回复
guichun68 - 80后IT男
Wxin
雪诺 - 90后IT男