Failed to apply plugin [id 'com.android.application'] 和 Could not find com.android.tools.build:gradle:2.XX的最正确的解决方法
发现android studio是真的可爱啊,上一秒还没问题可以build运行,下一秒就出错。。。好,你任性,你牛逼。。
说下今天又遇到的两个问题:Failed to apply plugin [id 'com.android.application']和Could not find com.android.tools.build:gradle:2.XX.
1.Failed to apply plugin [id 'com.android.application']. Could not create plugin of type 'AppPlugin'.
Error:(1, 1) A problem occurred evaluating project ':eventactiondispatcher'.
> Failed to apply plugin [id 'com.android.application']
> Could not create plugin of type 'AppPlugin'.
If using the gradle wrapper, try editing the distributionUrl in D:\as_workspace\RecyclerView\gradle\wrapper\gradle-wrapper.properties to gradle-2.14.1-all.zip
刚开始遇到我是有点蒙逼的,真是佩服google,每次都能让我遇到不一样的问题。吐槽归吐槽,问题就得解决。
就按照提示编辑项目下的这个文件:gradle\wrapper\gradle-wrapper.properties。
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
最后一行改成最新的。。这次我是在线更新的,还担心会不会被墙,还好,一会就下完了。。如果你在这里下载很慢的话,推荐你离线更新,至于怎么离线更新,参考我这篇博客:教新手一步步解决:Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to和更新gradle问题
就在我以为把gradle更新之后就没问题啦,谁知道又出来一个更牛逼的:Error:Could not find com.android.tools.build:gradle:2.14.1.
2.Error:Could not find com.android.tools.build:gradle:2.14.1.
你让我更新到2.14.1.然后你又说找不到!!fuck!!
rror:Could not find com.android.tools.build:gradle:2.14.1.
Searched in the following locations:
file:/D:/Tools/android_studio2.1stable/gradle/m2repository/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.pom
file:/D:/Tools/android_studio2.1stable/gradle/m2repository/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.jar
Required by:
:RecyclerView:unspecified
问题中只是说找不到!!也没什么提示。百度了下,也在stackoverflow找了下发现都是让你把gradle版本往低了改!这个版本不合适,改成低的确实可以解决问题,向下兼容吗。但是有新的我为什么要改成低的呢,这肯定不能解决根本问题!于是在没有任何参照的情况下,我试了试,很好一次就成功啦。果然跟我想的一样,这种问题嘛,只要把插件什么的都改成最新的,一般就解决问题。
你只要一步把Android Plugin Version改为最新的:2.2.0-beta3(这是目前最新的)。直接在Project Structru->Project->Android Plugin Version 中改了就好!
查看最新的Android Plugin Version:https://jcenter.bintray.com/com/android/tools/build/gradle/
查看最新的Gradle:Gradle Distributions。
这是我配好之后的配置:

Failed to apply plugin [id 'com.android.application'] 和 Could not find com.android.tools.build:gradle:2.XX的最正确的解决方法的更多相关文章
- Failed to apply plugin [id 'com.gradle.build-scan']
把spring源码clone下来之后,使用gradle编译不通过,异常日志如下: FAILURE: Build failed with an exception. * Where: Build fil ...
- com.android.tools.build:gradle:X.XX.XX:gradle.jar 插件无法下载问题
在使用Android Studio 这个IDE时,出现com.android.tools.build:gradle:X.XX.XX:gradle.jar 插件无法下载问题 可能的原因就是网速不好或者依 ...
- AS中加载gradle时出现Gradle sync failed: Could not find com.android.tools.build:gradle.的错误
时间:2019/12/7 这次接着整理加载gradle时出现的错误 出现的错误: Gradle sync failed: Could not find com.android.tools.build: ...
- Could not find com.android.tools.build:gradle:1.3.0.
* What went wrong: A problem occurred configuring project ':TZYJ_Android'.> Could not re ...
- Error:Could not find com.android.tools.build:gradle:3.0.0
Error:Could not find com.android.tools.build:gradle:3.0.Searched in the following locations: file ...
- Android Studio下“Error:Could not find com.android.tools.build:gradle:2.2.1”的解决方法
ref from: Android Studio下“Error:Could not find com.android.tools.build:gradle:2.2.1”的解决方法http://blog ...
- Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci
Error:(1, 0) The android gradle plugin version 3.0.0-alpha1 is too old, please update to the lates ...
- Could not find com.android.tools.build:gradle:3.0.0-alpha3
最近使用Android Studio 3.0 canary 3 时新建项目遇到标题所示错误,后网上找到解决办法.记录如下: 在项目的build.gradle文件中添加如下内容即可解决. reposit ...
- Could not find com.android.tools.build:gradle:3.3.0.
导入新项目时报错: Error:Could not find com.android.tools.build:gradle:3.3.0. Searched in the following locat ...
随机推荐
- laravel吐槽系列之一
最近项目中经常使用到了laravel框架,对于这个框架之前只是弱弱地接触了一点,没有深入接触,这下有时间好好研究它了(主要是不得不研究了).说实话,laravel让我打开眼界了,之前对框架的使用一直停 ...
- ES6笔记(2)-- let的块级作用域
系列文章 -- ES6笔记系列 一.函数级作用域 我们都知道,在ES6以前,JS只有函数级作用域,没有块级作用域这个概念 没有块级作用域,有利有弊,利于方便自由,弊于作用域内的变量容易被共享,例如这个 ...
- [译]学习IPython进行交互式计算和数据可视化(四)
第三章 使用Python进行数字计算 尽管IPython强大的shell和扩展后的控制台能被任何Python程序员使用,但是这个工具最初是科学奖为科学家设计的.它的主要设计目标就是为使用Python进 ...
- No assembly found containing an OwinStartupAttribute
自从在ASP.NET MVC中使用NuGet添加SignalR类库之后,再次运行程序时,它出现了一个异常: Server Error in '/' Application. The following ...
- 你应该知道的 RPC 原理
作者:伯乐在线 - meituanalibaba 网址:http://blog.jobbole.com/92290/ 在校期间大家都写过不少程序,比如写个hello world服务类,然后本地调用 ...
- 【C#】VS2015开发环境的安装和配置(一)2016-08-03更新
分类:C#.VS2015.WPF.ASP.NET MVC.Android.iOS.Unity3D: 更新日期:2016-08-03 一.简介 为了避免网上乱七八糟的过时介绍,避免误导初学者,这次把至2 ...
- ASP.NET MVC 网站开发总结(四)——校友平台开发总结
又历经一个多月的努力,学校的一个校友平台项目也接近内测的尾声了,简单的总结一下这次的项目开发. 与上次做Wing工作室的门户网站相比,同样是团队开发,参与的人员多了一个,用的时间也差不多一个月,但从总 ...
- win10下vs2015创建asp,net core项目并运行在ubuntu14.04下
上文说了.net core程序在win10与ubuntu下运行,用的是示例程序(https://github.com/aspnet/cli-samples),今天用vs2015 构建asp.net c ...
- HTTP 错误 500.19 - Internal Server Error 错误解决
今天在测试部署站点是遇到一个问题 HTTP 错误 500.19 - Internal Server Error 如下图,在网上搜了写解决方法,什么设置iis目录浏览,删除web.config中配置, ...
- Jquery验证插件 JqueryValidation 动态验证用户名等
可以参考:http://www.w3cschool.cc/jquery/jquery-plugin-validate.html //form1 验证用户名 $("#form1"). ...