[英]Manifest Merger Failed when importing my aar library into project
Iam是开发android库的新手。最近需要将我的应用程序的某些部分集成到其他客户端应用程序。 为此,我已经通过sonatype将aar格式的库上传到了Maven仓库。
但是当我将此库集成到其他应用程序时出现了问题。我遇到了一些错误-
错误:将字节码转换为dex时出错:原因:com.android.dex.DexException:多个dex文件定义了Lcom / android / volley / Response $ ErrorListener;
还有更多类似的东西。
我认为到目前为止的问题来自应用程序和库中定义的多个依赖关系。
我的资料库中有我做错的事情吗,我们如何从应用程序中删除重复的资料库。
我尝试了许多选项,例如“ multidex enable true和preDexLibraries = false”选项,但该属性均无效。
任何帮助表示赞赏。
我的图书馆应用级别的gradle是:
apply plugin: 'com.android.library'
apply from: 'maven-push.gradle'
android {
compileSdkVersion 26
useLibrary 'org.apache.http.legacy'
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
consumerProguardFiles 'proguard-rules.pro'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
useProguard true
//consumerProguardFiles 'proguard-rules.pro'
buildConfigField "String", "BASEURL", PROD_SERVICE_URL
buildConfigField "String", "MERCHANT_ID", MERCHANT_ID
buildConfigField "String", "ACCESS_CODE", ACCESS_CODE
}
debug {
buildConfigField "String", "BASEURL", STAGING_SERVICE_URL
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.jpardogo.googleprogressbar:library:1.2.0'
implementation 'com.karumi:dexter:4.2.0'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
implementation 'com.squareup.okhttp:okhttp:2.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'org.jsoup:jsoup:1.7.3'
implementation 'com.mcxiaoke.volley:library:1.0.17'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.jakewharton:disklrucache:2.0.2'
//implementation 'com.google.android.gms:play-services-base:15.0.1'
//compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:multidex:1.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
task deleteJar(type: Delete) {
delete 'libs/jars/logmanagementlib.jar'
}
task createJar(type: Copy) {
from('build/intermediates/bundles/release/')
into('libs/jars/')
include('classes.jar')
rename('classes.jar', 'logmanagementlib.jar')
}
createJar.dependsOn(deleteJar, build)
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.