LoginSignup
1
2

More than 3 years have passed since last update.

「Failed to notify project evaluation listener.」のエラーを解決する

Last updated at Posted at 2020-11-11

症状

Android のプロジェクトをビルドしようとすると、下記のエラーが出た。

A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > org.gradle.api.file.ProjectLayout.fileProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/RegularFileProperty;

解決方法

(Android 初心者のあてずっぽう解決法です)

1. 新しいプロジェクトを作る

新しい Android の空プロジェクトを作り、ビルドする。
次以降のステップで、ここの設定を基準にしていく。

2. build.gradle を編集する

{root}/build.gradle の gradle のバージョンを、1. で作った動いているものに揃える。

この部分を合わせる
classpath 'com.android.tools.build:gradle:{x.x.x}'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

すると、新しく下記のようなエラーが出た。

Minimum supported Gradle version is 6.5. Current version is 6.1.1. If using the gradle wrapper, try editing the distributionUrl

3. gradle-wrapper.properties を作成する

1. で作ったプロジェクトの下記ファイルを同じ位置にコピーしてくる。

  • {root}/gradle/wrapper/gradle-wrapper.properties
  • {root}/gradle/wrapper/gradle-wrapper.jar

4. クリーンビルド

クリーンビルド、それができなければ Android Studio 再起動
これで動くようになった。

参考

https://qiita.com/nobuoka/items/09cbdcd4716b930abdc4
https://qiita.com/izuki_y/items/26e5735a26a3494b4833#errorminimum-supported-gradle-version-is

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2