异常如下:

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. Nginx 在 Linux 下安装与搭建集群

    搭建集群图例 集群搭建图如下,为了简单一点,使用一个Nginx服务器+两个Tomcat服务器,省略数据库部分: 环境说明 Linux 为 CentOS 7.2 发行版 + Java jdk 1.8 + ...

  2. 解决:@Auarowired为null

    使用@Auarowired时程序报空指针.如图: 将private 更改为 public 即可

  3. Vertical Center TextView . 竖直居中的UITextView

    @interface VerticalCenterTextView : UITextView @end @implementation VerticalCenterTextView - (void) ...

  4. Android流媒体开发之路三:基于NDK开发Android平台RTSP播放器

    基于NDK开发Android平台RTSP播放器 最近做了不少android端的开发,有推流.播放.直播.对讲等各种应用,做了RTMP.RTSP.HTTP-FLV.自定义等各种协议,还是有不少收获和心得 ...

  5. MySQL与MongoDB的不同

    数据存放的巨大不同

  6. mysql语句练习50题

    为了练习sql语句,在网上找了一些题,自己做了一遍,收益颇多.很多地方换一种思路,有更好的写法,欢迎指正. 题目地址:https://blog.csdn.net/fashion2014/article ...

  7. pve-备份

    一个50g的磁盘,用了13分钟 INFO: starting new backup job: vzdump 111 --node cu-pve04 --mode snapshot --compress ...

  8. RNN系列

    漫谈RNN之梯度消失及梯度爆炸:http://bbs.imefuture.com/article/4405 漫谈RNN之长短期记忆模型LSTM:http://bbs.imefuture.com/art ...

  9. 分享:陆行鸟BGM合集

    第39首是原版哦 https://pan.baidu.com/mbox/homepage?short=pMkAqhX

  10. 查询SQL Server数据库所有表字段备注

    SELECT 表名 = case when a.colorder=1 then d.name else '' end, 表说明 = case when a.colorder=1 then isnull ...