android - 任务 ':app:javaPreCompileDebug' 执行失败。> 执行任务 ':app:javaPreCompileDebug' 时取消构建
问题描述
构建输出的详细信息:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:javaPreCompileDebug'.
> Build cancelled while executing task ':app:javaPreCompileDebug'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Build cancelled while executing task ':app:processDebugResources'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 7s
12 actionable tasks: 6 executed, 6 up-to-date
build.gradle(:app)
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.btp.classroom"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20"
//noinspection GradleCompatible
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.2.1' //1
implementation 'androidx.legacy:legacy-support-v4:1.0.0' //2
implementation 'com.google.firebase:firebase-auth:20.0.1'
implementation 'com.google.firebase:firebase-database:19.5.1'
implementation 'com.google.firebase:firebase-storage:19.2.0'
implementation 'com.firebaseui:firebase-ui-database:4.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.firebase:firebase-core:18.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
}
apply plugin: 'com.google.gms.google-services'
解决方案
尝试在顶部编译 gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
还要删除底部的这个插件(为什么它还在那里?所有插件都在顶部)
这也看起来像插件的未完成实现:
com.google.gms.google-services
推荐阅读
- java - 基于spring配置文件导入bean资源
- swift - 如何断言结构符合协议?
- python - 如何使用 BrowserStack Appium 和 Python 创建移动自动化应用程序测试?
- python-3.x - 获取在消息上添加表情符号的用户列表
- scheduling - 活动运行的 iCalendar 重复规则:每两周,周一和周三,活动一天内的每 30 分钟?
- php - PHP - 从连接数组中删除键
- reactjs - 以用户身份从前端下载图像(我有链接)?
- go - 当 NextDecoder 依赖于上一层而不是当前层时,如何正确编写自定义层?
- javascript - 新的 div CSS 不采用“top”和“left”类型
- kubernetes - kustomize configmap 命令:它有什么作用?