Could not resolve all files for configuration ':app:debugCompileClasspath'.ソリューション
1618 ワード
例外は次のとおりです.
ソリューションは、プロジェクトレベルでのbuild.gradleファイルに次のコードを追加します.
Error:FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-ads:latest.release.
Required by:
project :app
> Could not resolve com.google.android.gms:play-services-ads:12.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/google/android/gms/play-services-ads/12.0.1/play-services-ads-12.0.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/android/gms/play-services-ads/12.0.1/play-services-ads-12.0.1.pom'.
> Read timed out
* 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
BUILD FAILED in 35s
ソリューションは、プロジェクトレベルでのbuild.gradleファイルに次のコードを追加します.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1' // ,
classpath 'com.google.gms:google-services:4.0.1' //
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral ()
maven {url 'https://dl.bintray.com/jetbrains/anko'} // , , maven
maven {url "https://maven.google.com"} //
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}