Android Studio 4.0升级到version 4.1出现Could not determine the dependencies的解决办法
Android Studio 4.0升级到version 4.1后出现以下报错,信息如下:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.github.cookpad:puree-android:4.1.7.
Required by:
project :app
> Could not resolve com.github.cookpad:puree-android:4.1.7.
> Could not get resource 'http://maven.xxx.cn/repository/maven-aliyun/com/github/cookpad/puree-android/4.1.7/puree-android-4.1.7.pom'.
> Could not HEAD 'http://maven.xxx.cn/repository/maven-aliyun/com/github/cookpad/puree-android/4.1.7/puree-android-4.1.7.pom'. Received status code 503 from server: Service Unavailable
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5s
解决办法:加上allproject.repositories 块,然后把仓库全都添加进去。
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io'}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io'}
}
}
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。