Failed to notify project evaluation listener error in Android Studio

Fixed it by changing the MaterialDialogs lib version to

compile('com.afollestad.material-dialogs:core:0.8.5.9@aar') { transitive = true }

I had a similar problem when I moved to a higher level of gradle. Found the answer here. Try changing the gradle level In my case, this version helped

dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
}

and this gradele version throws mistakes

'com.android.tools.build:gradle:2.2.2'

'com.android.tools.build:gradle:3.0.0'

Just do not forget to change distributionUrl in gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip