java - Android构建项目错误:任务执行失败
问题描述
我是 Android Studio 的新手,如果我删除 Room Library,我不知道这是什么问题 它可以工作,但有 Room Dependency 它有错误,我从我的项目文件夹中删除了 Build 和 .gradle 文件夹,没关系你能帮我?
我的 Build.gradle :
它的房间图书馆问题??
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.mvp_sample_todolist"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary(true)
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
def room_version = "2.3.0"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
}
解决方案
如果 vpn 已打开,请确保您的 vpn 已打开,更改您的 gradle 插件版本
推荐阅读
- rest - 用于获取存储库列表的 Azure REST API 返回 0 个存储库
- mysql - ORDER BY 子句中的布尔表达式
- git - 使用 fork-point 在 git 中进行修订选择
- javascript - 将 SVG 动画转换为图像序列
- reactjs - 使用 props 在 react 中传递身份验证令牌有哪些安全风险?
- javascript - 为什么我的“mapDispatchToProps”看不到我的操作功能?
- python - 在电子邮件正文中发送样式化的数据框
- sql - 如何使用 AM 和 PM Oracle SQL 订购表示日期和时间的 VARCHAR2 列?
- android - Android:带有左右图标的下拉输入
- android - 如何在 BuildSrc 中创建 FlavorConfig?