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.
Copy Task is just a simple one like this:
task copyNodeModules(type: Copy) { group="_webapp" from('./src/main/ts/node_modules') { include '**/*' exclude '**/lite-server' exclude '**/json-server' exclude '**/.bin' } into project.buildDir.path + '/resources/someFolder' }
If you have some custom plugins that require you to import your project from the IntelliJ IDEA model, press Ctrl+Shift+A and search for the Project from Existing Sources action. In the dialog that opens, select a directory containing a Gradle project and click OK. IntelliJ IDEA opens and syncs the project in the IDE.
Going to Settings -> Auto Import -> Exclude from auto import and completion
and adding 'com.sun.org.apache.xalan.internal.xsltc.compiler'
fixed this for me.
check your build.gradle see if it contains at the 1st line, just remove this line will fix the issue.
import com.sun.org.apache.xalan.internal.xsltc.compiler.Copy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With