FIX: [Android build error] Failed to notify project evaluation listener

Context

I picked up some quite recent Android sample code, and it failed to build with the error message:

Failed to notify project evaluation listener. 
> org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;

Context

Android Studio 4.1.1 / Korlin 1.3.21 . The answer not wasn’t found rightaway anywhere so far… so I decided to post here for someone to find.


Solution

In the high level build.gradle, update Gradle version to the latest! In the case:

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

Then, if and when the Android Studio GUI prompts for Gradle plugin update, run it then to get to 4.1.1 and beyond.
For me, it did not work just by directly changing the com.android.tools.build:gradle to 4.1.1 directly!

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *