当AndroidStudio加载工程的时候:报以下错误:

详细错误:

Could not find method implementation() for arguments [file collection] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

在工程的app/build.gradle中查看:

修改工程的app/build.gradle,compile -修改成--> implementation

【解决此问题的第一步:】


查看工程的-build.gradle:

 打开一个,在当前电脑,当前AndroidStudio正常编译运行OK的工程的build.gradle文件:

copy  classpath 'com.android.tools.build:gradle:3.2.1'

【解决此问题的第二步:】

修改工程的-build.gradle,为 classpath 'com.android.tools.build:gradle:3.2.1'

成功解决:


总结解决细节:解决这种类型的错误,一定一定要仔细分析报错的详情(例如:翻译报错详情),特别要注意的是,报错详情中 有没有提示版本相关的信息,非常重要;

总结解决步骤:

为什么要修改 compile 为 implementation:

implementation是gradle版本3.0之后才支持的,出现该问题代表你的gradle版本过低。

解决步骤:

  第一步:将implementation改为compile

  第二步:升级build.gradle文件中的Gradle版本

Android-Could not find method implementation() for arguments的更多相关文章

  1. Error:(23, 0) Could not find method implementation() for arguments [directory 'libs'] on object of t

    Error:(28, 0) Could not find method implementation() for arguments [com.android.support:appcompat-v7 ...

  2. #warning Incomplete method implementation怎么修改?

    #warning Incomplete method implementation怎么修改?       各位朋友,我在做一个表格视图的例子,在tableview方法里总有几个warning:#war ...

  3. Error:Could not find method google() for arguments [] on repository container

    Error:Could not find method google() for arguments [] on repository container. Consult IDE log for m ...

  4. android studio 报ambiguous method call

    如题,在android studio中调用this.toString时,提示的错误信息是ambiguous method call. both get class () in object and g ...

  5. [Android ADB] An auto-input method for Android and Windows

    The Valentine's Day is coming. Here is an auto-input method and you may use it to send multiple word ...

  6. Android Gradle 依赖配置:implementation & api

    背景: Android Gradle plugin 3.0开始(对应Gradle版本 4.1及以上),原有的依赖配置类型compile已经被废弃,开始使用implementation.api和anno ...

  7. Android Studio升级后报 method not found: 'runProguard'的错误

    今天升级了下Android Studio,然后发现更新gradle,然后在sync项目的时候总是报  method not found: 'runProguard'的错误 找了很多发现不对. 最后解决 ...

  8. Could not find method google() for arguments [] on repository container,rn 集成react-native-camera 出现此错误的解决方法

    (1) app/build.gradle android { compileSdkVersion buildToolsVersion "25.0.2" } compile (pro ...

  9. android kotlin Gradle DSL method not found: '1.2.51()'错误,be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).

    同步的时候遇到这个问题,从log上看是因为gradle的版本不包含kotlin 1.2.51这个method,具体原因我也不是很清楚,大概猜测是kotlin版本的问题,而最新的版本就是1.2.51,所 ...

随机推荐

  1. 看懂 Fiddler 的瀑布图

    最近准备给组内的新同学们分享下 Fiddler 这枚神器,可以讲的地方太多,我打算把一节课讲不完的内容写在博客上,大家可以随便看看.今天先介绍下 Fiddler 的瀑布图. 每个网络请求都会经历域名解 ...

  2. UI设计技术分享:教你几个设计技巧让老板对你的设计赞不绝口

    我们做任何设计都离不开大小与重复的运用,这样能使我们的设计更加理性和科学,经得起推敲,那么我们一起来探讨下如何在产品设计中运用这一方法. 为什么大的物体更吸引眼球    ▲如上图所示,a球会比右边b球 ...

  3. [SoapUI] Property Expansion in soapUI

    1. Property Expansion in soapUI SoapUI provides a common syntax to dynamically insert ("expand& ...

  4. windows mysql主 Linux mysql 从 主从同步,读写分离

    Mysql –master linux-slave 一.My.ini: Server-id=1 relay-log=relay-bin relay-log-index=relay-bin-index ...

  5. Netsharp下微信菜单以及OAuth

    一.OAuth介绍 在微信开发中,当打开一个页面是,业务场景一般会基于粉丝绑定用户信息,即页面需要基于粉丝和用户的身份处理业务逻辑. 在微信中打开一个页面有三个场景: 1.文本回复中直接包含url 2 ...

  6. PHP代码不应有的坏习惯

    >>使用echo取代print >>使用str_replace取代preg_replace, 除非你绝对需要 >>不要使用 short tag >>简单 ...

  7. DevOps:从理念到实施

    转载自:http://os.51cto.com/art/201404/436794.htm DevOps这个新理念的出现,是为了应对IT环境中普遍面临的一些挑战.开发团队要求的不断满足新的客户需求,并 ...

  8. HDU 6129 Just do it

    题意:给你一个包含n个数的序列A和一个数m,序列B中的数是序列A经过异或得到的,比如:b[i]=a[1]^a[2]^…..^a[i].现在让你求经过m次异或后,序列B的值.  思路:这题其实和杨辉三角 ...

  9. c#中的as,is和强转

    as和强转之间的区别: as转换类型失败时不会抛出异常:强转类型失败时会抛出异常 引入is先对变量进行检验: if (foo is int) { i = (int)foo; } logger log ...

  10. 2018.12.15 bzoj3676: [Apio2014]回文串(后缀自动机)

    传送门 对原串建立一个后缀自动机,然后用反串在上面匹配. 如果当前匹配的区间[l,r][l,r][l,r]包裹了当前状态的endposendposendpos中的最大值,那么[l,maxpos][l, ...