异常如下:

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
解决方案如下:
在project级别下的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
}
---------------------
作者:晨诺星空
来源:CSDN
原文:https://blog.csdn.net/wjj1996825/article/details/80900875
版权声明:本文为博主原创文章,转载请附上博文链接!

Could not resolve all files for configuration ':app:debugCompileClasspath'.解决方案的更多相关文章

  1. Could not resolve all files for configuration;Andriod在build.gradle添加compile files()报错

    在build.gradle中添加个 compile files('libs/alipaySdk-20170922.jar') 就一直报这个错误 Error:Could not resolve all ...

  2. databus编译:Could not resolve all dependencies for configuration ':databus2-relay:databus2-event-producer-mock:compile

    FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for c ...

  3. Could not resolve all dependencies for configuration ':classpath'

    我这里是copy过来的项目包名没有修改,导致依赖找不到

  4. 【Hybrid App】关于Hybrid App技术解决方案的选择

    [引言]近年来随着移动设备类型的变多,操作系统的变多,用户需求的增加,对于每个项目启动前,大家都会考虑到的成本,团队成员,技术成熟度,时间,项目需求等一堆的因素.因此,开发App的方案已经变得越来越多 ...

  5. 没有对“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”的写访问权限 的解决方案

    问题情况: 在64位机器上运行Web服务,然后在配置好之后测试访问的时候出现如下提示:

  6. 微信中通过页面(H5)直接打开本地app的解决方案

    简述 微信中通过页面直接打开app分为安卓版和IOS版,两个的实现方式是完全不同的. 安卓版实现:使用腾讯的应用宝,只要配置了“微下载”之后,打开链接腾讯会帮你判断本地是否已经安装了app,如果本地安 ...

  7. js在微信、微博、QQ、Safari唤起App的解决方案

    首先看下完整的流程: 简单说下universal link 在iOS9之前,唤起方式和现在安卓是一个的,都是使用scheme进行唤起,这种方式有个小问题,每次唤起,都会给个提示:是否打开xx应用,这样 ...

  8. H5 唤起 APP的解决方案

    H5 页面唤起APP或跳转到下载APP的某个链接地址.总结如下: 在 IOS 中, 系统版本在 8 以下时,可以监听页面的 pagehide / visibilitychange 事件. 系统版本大于 ...

  9. Electron 发生错误 "Cannot find module app"的解决方案

    运行一个electron小demo出现的一个错误信息:Cannot find module app 原代码如下所示: var app = require('app'); var BrowserWind ...

随机推荐

  1. No plugin found for prefix 'war' in the current project and in the plugin groups

    解决办法: 在pom里面添加 : <dependency> <groupId>org.apache.maven.plugins</groupId> <arti ...

  2. laravel5.6 邮件队列database驱动简单demo

    一: 邮件初始参数配置 配置 .env  (demo示例是163邮箱,开启POP3和SMTP服务,获取授权密码) MAIL_DRIVER=smtp MAIL_HOST=smtp.163.com MAI ...

  3. Gradle 详解

    Gradle简单来说,就是工程的管理,帮我们做了依赖,打包,部署,发布等工作.就像一个管家管理我们的项目,我们只用关心写代码就可以了. 1 gradle-wraaper.properties 主工程的 ...

  4. 获取react中高阶组件方法

    什么是高阶组件? 高阶组件就是接受一个组件作为参数并返回一个新组件的函数.这里需要注意高阶组件是一个函数,并不是组件,这一点一定要注意.同时这里强调一点高阶组件本身并不是 React API.它只是一 ...

  5. oracle 11g 数据库恢复技术 ---02 控制文件

    oracle 11g 数据库恢复技术 ---02 控制文件 SYS@ orcl >show parameter control_file NAME TYPE VALUE ------------ ...

  6. 【GTS】关于GtsTetheringTestCases模块的几个失败项

    GTS---关于GtsTetheringTestCases模块的几个失败项 1.run gts -m GtsTetheringTestCases -t com.google.android.tethe ...

  7. 在layui中,新的页面怎么获取另一个页面传过来的数据,并可以对数据进行判断,layui中的后台分页(table)。

    例如:打开一个新页面的同时,传数据. layer.open({ type: 2, title: '新增项目', shadeClose: false, shade: [0.3], maxmin: tru ...

  8. API网关spring cloud gateway和负载均衡框架ribbon实战

    通常我们如果有一个服务,会部署到多台服务器上,这些微服务如果都暴露给客户,是非常难以管理的,我们系统需要有一个唯一的出口,API网关是一个服务,是系统的唯一出口.API网关封装了系统内部的微服务,为客 ...

  9. Nacos1.1.3小试牛刀

    什么是 Nacos(摘自https://nacos.io/zh-cn/docs/quick-start.html) Nacos 致力于帮助您发现.配置和管理微服务.Nacos 提供了一组简单易用的特性 ...

  10. spring-第十六篇之AOP面向切面编程之Spring AOP

    1.上一篇介绍了AspectJ在AOP的简单应用,让我们了解到它的作用就是:开发者无需修改源代码,但又可以为这些组件的方法添加新的功能. AOP的实现可分为两类(根据AOP修改源码的时机划分): 1& ...