我正在尝试在Android App中实现docusign,但是当我在build.graddle中添加实现行时,gradle同步运行正常,但是当我在设备中进行编译时,我总是看到相同的错误:
Program type already present: org.apache.oltu.oauth2.common.OAuth$HttpMethod
Message{kind=ERROR, text=Program type already present: org.apache.oltu.oauth2.common.OAuth$HttpMethod, sources=[Unknown source file], tool name=Optional.of(D8)}
我也下载了 docusign-android-starter-kit ,它具有相同的错误。
我已经搜索了一个解决方案,但没有任何有效的方法,我尝试添加这种依赖关系,但无法正常工作...
implementation ("com.docusign:docusign-esign-java:2.6.1"){
exclude group: 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2'
}
我的build.gradle是这样的:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.commonms.android_docusign"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.itextpdf:itextg:5.5.10'
implementation 'com.google.code.gson:gson:2.8.0'
implementation ("com.docusign:docusign-esign-java:2.6.1"){
exclude group: 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.client'
}
implementation group: 'org.bitbucket.b_c', name: 'jose4j', version: '0.5.2'
implementation group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':signaturesdk')
implementation project(path: ':pdfViewer')
有人可以帮助我吗? 非常感谢!
答案 0 :(得分:1)
configurations.all {exclude group: 'org.apache.oltu.oauth2', module: 'org.apache.oltu.oauth2.common'}