Flutter: > Failed to notify project evaluation listener. org.gradle.api.file.ProjectLayout.directoryPropertyLorg/gradle/api/file/DirectoryProperty;

Viewed 655

I am getting this error when i am trying to get the release apk of my app.

Below are all the data.

Console log



FAILURE: Build failed with an exception.

* Where:
Build file 'D:\pro\food\android\build.gradle' line: 30


* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
   > Failed to notify project evaluation listener.
      > org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s

Picked up _JAVA_OPTIONS: -Xms256m -Xmx2048m
Running Gradle task 'assembleRelease'...                            4.5s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1

android level build.gradle file

buildscript {
    repositories {
        maven{url 'https://dl.google.com/dl/android/maven2'}
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2.'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.1'
        classpath 'com.google.gms:google-services:4.3.3'
    }
}

allprojects {
    repositories {
        maven{
            url 'https://maven.gppgle.com'
        }
        google()
        jcenter{ url "http://jcenter.bintray.com/"}
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

gradle-wrapper properties

#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3.2-all.zip

I have tried clearing the caches, restarting android studio.

Someone please help me with this issue.

Any kind of help will be appreciated.

1 Answers

Open your build.gradle file in android folder. (not in app)

inside dependency block, update classpath of tools.build.gradle like this,

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