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

自闭症网瘾萝莉.ら 提交于 2020-11-29 21:05:44

问题


There is an open source project here.

After trying multiple times to build it, there is an error that make build Failed :

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.

Here is line 19 :

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

And the defined PrivateData.merge(...) is in /buildSrc/src/main/java/MergePrivateData.kt file:

object PrivateData {

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

The source successful build is here and I follow the steps, but I can not find my mistake.

Please help me.


回答1:


  1. From the apps folder remove the buildSrc file.
  2. From the root copy the buildSrc folder into the apps folder and rebuild it.


来源:https://stackoverflow.com/questions/64742632/could-not-get-unknown-property-privatedata-for-object-of-type-org-gradle-api-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!