AndroidX错误:无法解析:appcompat

AndroidX错误:无法解析:appcompat,android,gradle,android-appcompat,androidx,Android,Gradle,Android Appcompat,Androidx,创建新项目时,默认情况下,我有以下依赖项: dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'ju

创建新项目时,默认情况下,我有以下依赖项:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
同步项目在开始时失败,我无法修复它。错误是针对
'androidx.appcompat:appcompat:1.1.0'
gradle无法解析此依赖项

错误日志:

ERROR: Failed to resolve: appcompat
Affected Modules: app
Gradle模块项目:

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
我检查了下载URL,结果是404:

知道如何修复它吗?

试试这个:-

实现“androidx.appcompat:appcompat:1.1.0”


实现“androidx.core:core ktx:1.1.0”

删除Gradle Home(
.Gradle
)问题得到解决。可能是缓存损坏或是什么东西导致了错误。

我正在使用Java语言。请更新你的gradle文件和所有其他依赖项。然后清除并使其无效,然后重新启动android studio。我希望这会有帮助。我已经做了一切。唯一有效的方法是将这种依赖性降级到1.0.0版,但我认为这不是一个解决方案。发布完整的stacktraceThere不是stacktarce。只是一堆没能解决的问题@加布里埃马里奥蒂