The last Gradle build fails to find TestNG classes

With the last build

the dependency

testCompile group: ‘org.testng’, name: ‘testng’, version: ‘6.8’

is resolved correctly, but no TestNG packages and classes symbols can be found, a lot of errors like this happened:

error: package org.testng does not exist import org.testng.Assert;

At the same time, it works with the build