无法为 org.gradle.api.internal.initialization.DefaultScriptHandler 类型的对象获取未知 属性 'PrivateData'

Could not get unknown property 'PrivateData' for object of type org.gradle.api.internal.initialization.DefaultScriptHandler

有一个开源项目here

多次尝试构建后,出现构建失败的错误:

Task failed with an exception.

Where:

Build file '/src/apps/build.gradle' line: 19

What went wrong:

A problem occurred evaluating root project 'apps'.

Could not get unknown property 'PrivateData' for object of type org.gradle.api.internal.initialization.DefaultScriptHandler.

这是第 19 行:

buildscript {
    PrivateData.merge(project, "all-apps")
    ...
}

定义的PrivateData.merge(...)/buildSrc/src/main/java/MergePrivateData.kt文件中:

object PrivateData {

    ...
    @JvmStatic
    @JvmOverloads
    fun merge(project: Project, dataDirName: String = "") {
    ...
    }
...
}

成功构建的来源是here,我按照步骤操作,但我找不到我的错误。

请帮帮我。

  1. apps 文件夹中删除 buildSrc 文件。
  2. 从根目录将 buildSrc 文件夹复制到 apps 文件夹并重建它。