找不到 com.github.ybq:Android-SpinKit:1.4.0

Could not find com.github.ybq:Android-SpinKit:1.4.0

我试图包含 spinkit,但是当我构建项目时它给我错误

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.github.ybq:Android-SpinKit:1.4.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/github/ybq/Android-SpinKit/1.4.0/Android-SpinKit-1.4.0.pom
       - https://repo.maven.apache.org/maven2/com/github/ybq/Android-SpinKit/1.4.0/Android-SpinKit-1.4.0.pom
     Required by:
         project :app

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

我不知道为什么它会突然发生我以前使用过 spinkit 但是没有给我任何这样的错误但是现在当我试图再次包含它时出现这个错误

使用 Android Studio Arctic Fox 2020.3.1

不要在项目级别 gradle 文件中添加 maven { url "https://jitpack.io" } 而是在 settings.gradle

中添加它

settings.gradle

repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
        jcenter() // Warning: this repository is going to shut down soon
    }

这解决了我和你一样的问题。