Idea cannot resolve symbol from gradle's buildSrc

Viewed 146

Cannot resolve symbol from gradle's buildSrc in intellij idea in main buils.gradle script. At the same time build script works just fine: Screenshot of warning in idea

Project structure:

build.gradle
gradle\wrapper\gradle-wrapper.properties
gradle\wrapper\gradle-wrapper.jar
buildSrc\src\main\java\foo\Bar.java

build.gradle:

import foo.Bar

task printBar() {
    doLast {
        println new foo.Bar()
    }
}

Idea shows foo.Bar in red and claims that: Cannot resolve symbol 'Bar'

But task printBar works and produce expected output.

Idea version: 2020.2.1 Community edition running on Windows 10.

Issue is not reproduceable on other machines. Resolving works fine on my Linux Idea 2020.2.1C installation with same project or Idea 2020.1U on other Windows machine. What I've already tried: invalidating caches, creating new project, different Gradle versions, different JDK versions, removing %USERPROFILE%/.gradle folder, removing all jetbrains products with config folders and reinstall Idea.

Any suggestions how to fix this?

0 Answers
Related