天天看点

(踩坑之路)一个错误:Cannot create task of type 'Copy' as it does not implement the Task interface.

I have a very annoying and unexplainable behaviour in IntelliJ 2016.1:

If using Gradle copy task in a build file IntelliJ adds upon any edit in this file this import on top:

com.sun.org.apache.xalan.internal.xsltc.compiler.Copy
           

which is of course not necessary since this task is built-in Gradle. Upon execution this leads to this error:

Cannot create task of type 'Copy' as it does not implement the Task interface.

把文件最上面的导包语句去掉就可以了.......