android - 无法修复无法解决:androidx.appcompat:1.1.0:
问题描述
我通过制作 Android 应用程序学习 java 并且无法修复同步错误“无法解决:androidx.appcompat:1.1.0:”
项目构建文件在这里
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com/' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用程序构建文件在这里
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.kayosystem.honki.chapter05.lesson21"
minSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//0608追加androidx.appcompat:appcompat:$appcompat_version
//0608取消compile 'com.android.support:appcompat-v7:24.+'
def appcompat_version = "1.1.0"
implementation "androidx.appcompat:$appcompat_version"
//For loading and tinting drawables on older versions of the platform
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
}
我在项目的构建 gradle 和应用程序文件中的构建 gradle 中都有 maven。这是因为只在项目的build gradle中编写maven时出现了同步错误。
解决方案
改变
implementation "androidx.appcompat:$appcompat_version"
至
implementation "androidx.appcompat:appcompat:$appcompat_version"
推荐阅读
- python - 使用 pandas 数据框,如何通读一列以找到“True”语句,然后继续创建新的数据框
- javascript - 如何在导航到屏幕之前使用密码身份验证并使用 React Native 中的底部选项卡导航器对其进行调整?
- c# - 将枚举[](字节)保存/加载到文件的最快方法
- rust - 如何在 Rust 中向上或向下舍入一个数字?
- ios - StackView(ios)中的视图未添加底部边框
- python - gzip -t 循环运行脚本
- javascript - 用对象反应状态
- c - 为 c 中的 char 分配负值打印“?” 在 macOS 上
- php - 在 CentOS Linux 上以二进制模式写入的疯狂 PHP fopen / fwrite / file_put_contents / move_uploaded_file 错误将 0x0D 添加到每个 0x0A
- python - 了解嵌套装饰器缺少所需的位置参数错误