【发布时间】:2019-01-08 13:33:24
【问题描述】:
我添加了一个新的 jar 文件作为模块并面临上述问题。我已经在我的应用程序 gradle 文件中实现了 okHttp。似乎 jar 文件也实现了相同的功能。知道如何解决吗?
编辑 ** - 发布我的应用构建 gradle 文件。我已将该库添加为项目,您还可以看到我在哪里实现了 OkHttp 库
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.bestdocapp.kiosk_opd"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
debuggable true
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
}
staging {
debuggable true
applicationIdSuffix ".debugStaging"
versionNameSuffix '-STAGING'
resValue "string", "app_name", "Kiosk Live"
}
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue "string", "app_name", "Kiosk"
debuggable true
}
}
dataBinding {
enabled = true
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.wdullaer:materialdatetimepicker:3.6.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.wdullaer:materialdatetimepicker:3.6.0'
implementation 'com.brandongogetap:stickyheaders:0.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.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(':library_name'))
}
【问题讨论】:
-
您可以发布您应用的 build.gradle 文件吗?
-
@Vall0n 编辑了我的问题。请检查
-
您是否尝试按照建议在 gradle.properties 中添加
android.enableD8=falsehere -
是的。但它表示该方法将很快被弃用。所以添加, android.enableD8=true 来解决它。添加它。但得到同样的错误