【发布时间】:2019-11-21 08:57:29
【问题描述】:
打开一个我已经工作了一段时间但几个月都没有打开的项目后,我在尝试编译我的 Android 项目时遇到错误。我得到的错误可以在这里看到:
我的项目构建gradle如下:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
而我的应用程序 build.gradle 依赖项如下(由于敏感数据而删除了一些元素):
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.2'
defaultConfig {
applicationId "com.x.x"
minSdkVersion 18
targetSdkVersion 27
versionCode 45
versionName "1.45.1"
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/jackson-core-2.7.0.jar')
implementation files('libs/jackson-databind-2.7.0.jar')
implementation files('libs/jackson-annotations-2.7.0.jar')
// for joda
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'joda-time:joda-time:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer:r1.5.2'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
implementation 'com.karumi:dexter:4.0.0'
implementation 'com.scottyab:aescrypt:0.0.1'
implementation 'com.wdullaer:materialdatetimepicker:3.4.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'net.sourceforge.htmlcleaner:htmlcleaner:2.16'
implementation 'io.sentry:sentry-android:1.7.5'
testImplementation 'junit:junit:4.12'
configurations.all {
exclude group: 'com.android.support', module: 'support-v13'
}
}
我试着换了
implementation files('libs/jackson-core-2.7.0.jar')
implementation files('libs/jackson-databind-2.7.0.jar')
implementation files('libs/jackson-annotations-2.7.0.jar')
到更新版本(2.9.9,我手动下载后),但无济于事。该错误与上图相同,但使用 2.9.9 而不是 2.8.7。
我还尝试将 implementation files 更改为 implementation,它利用 Gradle 下载插件,但它给出了同样的错误。
我当然也尝试过清理和重建项目,但也没有任何效果。
可以在https://pastebin.com/EPUuEXTd 看到来自我的构建输出窗口的完整错误。
我在 StackOverflow 和 Github 上查看了不同的答案,但没有发现可能与我有关的问题。
【问题讨论】: