无法将assembleRelease转换为任务

时间:2019-07-11 06:38:32

标签: android gradle

我正在尝试使用以下Gradle DSL发布我的图书馆:

publications {
    prodRelease(MavenPublication) {
        groupId appGroupId
        artifactId appReleaseArtifactId
        version libVersion
        artifact("${defaultOutputTargetDir}${outputFileNameRelease}"){
            builtBy('assembleRelease')
        }
        ext.repoType = 'Prod'
    }
}

在尝试发布时,总是出现错误:

> Cannot convert assembleRelease to a task.
The following types/formats are supported:
- A Task instance
- A Buildable instance
- A TaskDependency instance
- A Provider that represents a task output
- A Provider instance that returns any of these types
- A Closure instance that returns any of these types
- A Callable instance that returns any of these types
- An Iterable, Collection, Map or array instance that contains any of these types

这可能是什么问题?而且,这是在我将Gradle从4.6升级到5.1.1时开始发生的。

0 个答案:

没有答案