发现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的最正确的解决方法的更多相关文章

  1. Failed to apply plugin [id 'com.gradle.build-scan']

    把spring源码clone下来之后,使用gradle编译不通过,异常日志如下: FAILURE: Build failed with an exception. * Where: Build fil ...

  2. com.android.tools.build:gradle:X.XX.XX:gradle.jar 插件无法下载问题

    在使用Android Studio 这个IDE时,出现com.android.tools.build:gradle:X.XX.XX:gradle.jar 插件无法下载问题 可能的原因就是网速不好或者依 ...

  3. 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: ...

  4. Could not find com.android.tools.build:gradle:1.3.0.

    * What went wrong:          A problem occurred configuring project ':TZYJ_Android'.> Could not re ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. Could not find com.android.tools.build:gradle:3.0.0-alpha3

    最近使用Android Studio 3.0 canary 3 时新建项目遇到标题所示错误,后网上找到解决办法.记录如下: 在项目的build.gradle文件中添加如下内容即可解决. reposit ...

  9. 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 ...

随机推荐

  1. JVM之类加载器中篇

    先看一段代码吧! package com.tfdd.test; /** * @desc * @author chenqm * @date 2016年2月15日 */ public class Fina ...

  2. mvc通过ActionFilterAttribute做登录检查

    1.0 创建Attribute using System; using System.Collections.Generic; using System.Linq; using System.Web; ...

  3. 基于吉日嘎底层架构的Web端权限管理操作演示-日志管理

    权限管理要实现的效果是对“ 谁”可以访问“什么内容”,可以进行“哪些操作” 一系列权限的精细化控制.衡量一个软件好坏的重要标准是:它的权限体系是否足够细致.是否可以立体勾勒出信息对象的访问控制.前面4 ...

  4. 最近Google经常打不开?

    最近听好多同事讲google打不开,无法进行搜索,用了代理之后速度还是很慢,而百度搜索又不佳… 就在此分享一些google地址: 个人收藏夹的: 203.208.46.144(这段时间推荐使用这4个地 ...

  5. jquery更改加载图片大小

    <script type="text/javascript"> $("img").css("width","80%&q ...

  6. 【Java每日一题】20161108

    package Nov2016; import java.util.TreeSet; public class Ques1108 { public static void main(String[] ...

  7. line-height 属性

    p.small {line-height:90%} p.big {line-height:200%}     该属性会影响行框的布局.在应用到一个块级元素时,它定义了该元素中基线之间的最小距离而不是最 ...

  8. Focus

    在尘世中沉浸得越久,越无法集中精力去做好一件事. 缺乏学习!

  9. GUID全局唯一标识符

         全局唯一标识符(GUID,Globally Unique Identifier)是一种由算法生成的二进制长度为128位的数字标识符.GUID主要用于在拥有多个节点.多台计算机的网络或系统中. ...

  10. MUI(5)

    今天实现9宫格菜单.先上效果图: 就是这个效果咯,界面不太美观,底部导航栏是为了苹果用户没有返回按键设计的,只是为了方便演示而已,没有做过多的处理.首先先说一下这个底部导航栏如何实现,这个底部导航栏小 ...