I saw the problem even on command line and it helped when I added plugin management to the start of setting.gradle file:
pluginManagement {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
gradlePluginPortal()
}
}