In my case, this error occured when creating a new Android Studio (Android studio 3.2.1) Java Project with
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
So I´ve downgraded to
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
Not the best solution stay at an older version, but maybe it´s just a temporary bug in the beta as the NDK path in local.properties is still the same, but the IDE doesn´t complain anymore