当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. 网页启用Gzip压缩 提高浏览速度

    启用Gzip压缩的好处 它的好处显而易见,提高网页浏览速度,无论是之前说的精简代码.压缩图片都不如启用Gzip来的实在.下图为启用Gzip后的效果. Gzip压缩效率非常高,通常可以达到70%的压缩率 ...

  2. Java Http接收中文乱码解决

    当时url传递时,可用 byte[] bytes=reqdata_s.getBytes("ISO-8859-1"); String name=new String(bytes,&q ...

  3. UI设计教程分享:PS故障风海报制作教程

    1.首先找一张看起来很酷的图(也可以选择自己喜欢的图片):   2. 复制图层,点击添加图层样式,选择混合选项,在高级混合里面的通道选项,有R.G.B三个通道选项,默认是全部勾选的状态,选择其中一个勾 ...

  4. 【搜索】 Find The Multiple

    #include<stdio.h> #include<stdlib.h> #include<string.h> bool found; void DFS(unsig ...

  5. Java第2章笔记

    1.什么是变量:在程序运行过程中它的值是允许改变的量 2.java中常用的数据类型分为四类八种  第一类:整型   int(整数类型)     byte(字节类型)    short(短整形)     ...

  6. ManageEngine卓豪 IT管理峰会圆满结束

  7. Django之url定义和ORM框架的使用

    前言,Django安装 pip install django # 官网安装最新版本 pip install django -i "https://pypi.doubanio.com/simp ...

  8. 兼容ie透明书写

    filter:alpha(opacity=0); opacity:0;filter:alpha(opacity=70); opacity:0.7;

  9. scope属性

    scope属性 1.<bean>属性 2.作用:控制对象有效范围(单例.多例等) 3.<bean/> 标签对应的对象默认是单例的 3.1 无论获取多少次,都是同一个对象 4.s ...

  10. 8个开发必备的PHP功能--转(柒捌玖零)

    做过PHP开发的程序员应该清楚,PHP中有很多内置的功能,掌握了它们,可以帮助你在做PHP开发时更加得心应手,本文将分享8个开发必备的PHP功能,个个都非常实用,希望各位PHP开发者能够掌握. 1.传 ...