android gradle 和gradle plugin
android gradle 和gradle plugin
1、安装完AS3.5.2创建完项目一运行,报了如下错误
Error:Could not find com.android.tools.build:gradle:4.1. Searched in
the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://littlefogcat.top/example/com/android/tools/build/gradle/4.1
问题分析:
首先想到的是去看看我的grid : File =>Settings =>gradle
发现我gradle的是存在的
那么去看看项目的gridle版本:File=>project structure =>project 查看,发现我的
Android Gradle Plugin Version 版本和我的插件版本都是4.1
按理说因该没问题的啊,
但是实际是这样的么?
回到问题本身,再去看看错误提示信息没有找到C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.jar
再去他给的下载地址去看看,发现目前为止最新版本的gradle是2.3.0
好吧,那就把我的gradle plugin版本改为2.3.0
问题解决:
把我的gradle plugin版本改为2.3.0
2、新问题来了:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:)
at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:)
at org.gradle.configuration.project.LifecycleProjectEvaluator.access$(LifecycleProjectEvaluator.java:)
at org.gradle.configuration.project.LifecycleProjectEvaluator$.execute(LifecycleProjectEvaluator.java:)
at org.gradle.configuration.project.LifecycleProjectEvaluator$.execute(LifecycleProjectEvaluator.java:)
at org.gradle.internal.Transformers$.transform(Transformers.java:)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:)
at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:)
at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuildAction.execute(DefaultGradleLauncher.java:)
at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuildAction.execute(DefaultGradleLauncher.java:)
at org.gradle.internal.Transformers$.transform(Transformers.java:)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:)
at org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:)
at org.gradle.launcher.exec.GradleBuildController.configure(GradleBuildController.java:)
at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:)
at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$.execute(RunAsBuildOperationBuildActionRunner.java:)
at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$.execute(RunAsBuildOperationBuildActionRunner.java:)
at org.gradle.internal.Transformers$.transform(Transformers.java:)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:)
at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:)
at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$.call(ForwardClientInput.java:)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$.call(ForwardClientInput.java:)
at org.gradle.util.Swapper.swap(Swapper.java:)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$.run(StartBuildOrRespondWithBusy.java:)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$.run(DaemonStateCoordinator.java:)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:)
at org.gradle.internal.concurrent.StoppableExecutorImpl$.run(StoppableExecutorImpl.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':app'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$.run(DefaultScriptPluginFactory.java:)
at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:)
at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:)
... more
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method implementation() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
at org.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:)
at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:)
at build_cwcqry1dtacujy4w7qkivl3cy$_run_closure2.doCall(D:\Android\UIautoApplication\app\build.gradle:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:)
at groovy.lang.Closure.call(Closure.java:)
at groovy.lang.Closure.call(Closure.java:)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:)
at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:)
at org.gradle.api.internal.project.DefaultProject.dependencies(DefaultProject.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:)
at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:)
at org.gradle.internal.metaobject.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:)
at org.gradle.internal.metaobject.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:)
at org.gradle.internal.metaobject.MixInClosurePropertiesAsMethodsDynamicObject.invokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:)
at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:)
at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:)
at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:)
at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:)
at build_cwcqry1dtacujy4w7qkivl3cy.run(D:\Android\UIautoApplication\app\build.gradle:)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:)
... more
问题分析:gradle版本过低,不支持c....需要升级到3.0以上的版本
android gradle 和gradle plugin的更多相关文章
- 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 ...
- Gradle、Gradle Wrapper与Android Plugin for Gradle
欢迎和大家交流技术相关问题: 邮箱: jiangxinnju@163.com 博客园地址: http://www.cnblogs.com/jiangxinnju GitHub地址: https://g ...
- 彻底搞懂Gradle、Gradle Wrapper与Android Plugin for Gradle的区别和联系
首先用一段通俗易懂但是不是非常专业的话描述一下三者的概念.区别和联系. Gradle是个构建系统,能够简化你的编译.打包.测试过程.熟悉Java的同学,可以把Gradle类比成Maven. Gradl ...
- Android Gradle插件(plugin)版本(version)与Gradle、SDK Build Tools版本关系
具体关系如下图: 比如,Android Studio 2.0发布,其中有个新功能“Instant Run”,需要Android Gradle Plugin版本2.0.0以上,那么我们项目的.gradl ...
- 使用Android Studio和Gradle编译NDK项目之Experimental Plugin User Guide
转载自:http://tools.android.com/tech-docs/new-build-system/gradle-experimental Introduction The new exp ...
- Android studio 使用Gradle发布Android开源项目到JCenter 总结
1.注册账号 先到https://bintray.com注册一个账号. 这个网站支持 github 账户直接登录的 2.获取 bintray.user 和 bintray.apikey ...
- Android studio下gradle Robolectric单元测试配置
android studio下gradle Robolectric单元测试配置 1.Robolectric Robolectric是一个基于junit之上的单元测试框架.它并不依赖于Android提供 ...
- android studio 使用gradle 导出jar包,并打包assets目录
警告:本文年久失修. 随着android studio的升级 ,gradle的升级,严格按照本文的代码去做可能不会成功,希望依然可以作为解决问题的思路. 最近项目在做一个sdk,供别的开发者使用,所以 ...
- Android Studio :Android Studio 与 Gradle 深入【二】
转载:http://www.apkbus.com/forum.php?mod=viewthread&tid=255063&extra=page%3D2%26filter%3Dautho ...
随机推荐
- Raft——可理解的分布式一致性算法
Raft Understandable Distributed Consensus http://thesecretlivesofdata.com/raft/ 一个直观的动画,便于理解raft算法. ...
- Berry 异常处理 1: 语法和字节码设计
语法 最近在实现 Berry 的异常处理特性,进过初步的调查后决定使用类似 Python 的 try-except 异常处理模式,为此要引入三个新的关键字: try:表示异常捕获块的开始,位于异常捕获 ...
- 基于nginx+tomcat部署商城系统并连接数据库
需三台服务器nginx 192.168.200.111tomcat 192.168.200.112tomcat 192.168.200.113 192.168.200.111[root@localho ...
- Zabbix-1.8.14 安装
CentOS 6.9Apache 2.2PHP 5.3.3MySQL 5.1.73 1.下载安装zabbix软件源 在http://repo.zabbix.com/zabbix/1.8/rhel/6/ ...
- filter的使用场景
1.filter的使用场景:假如有一个对象数组A,获取数组中的指定类型的对象放到B数组中 我们在ES5先进行for循环遍历数组,再进行if 判断,如果数组中某个对象的类型符合要求,push 到一个新数 ...
- 最大字段和--GSS1 MUSHROOM ORZ
过于naive了= =作为一个知识点总结一下算了.主要就是合并.对于一个区间的最大字段和,可以分别事下面的两个区间的子段和,或者事左边的右边加右边的左边.然后搞一下 = = #include < ...
- nextJS使用注意事项
项目参考 nextJs-yicha 1. 采用方案 create-next-app.antd (1)安装 npx create-next-app --example with-ant-design m ...
- ZOJ3953-Intervals-贪心
目录 Catalog Solution: (有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 Catalog Problem:Portal传送门 原题目描述在最下面. 给你n个区间, ...
- Codeforces703D-Mishka and Interesting sum-离线树状数组
(有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 题意:传送门 原题目描述在最下面. 询问一个区间内出现次数为偶数次的数字的异或和. 思路: 先求出区间异或前缀和,其实就是出现次 ...
- Java设计模式简单总结
1.单例模式:在应用程序整个生命周期中,单例类的实例只有一个,并且会自动实例化.单例类的构造方法必须为私有,并且提供一个全局访问点 public class Test { private Test() ...