简体   繁体   English

Gradle 将本地模块视为远程依赖

[英]Gradle treating local module as remote dependency

dependencies {
    project.logger.lifecycle(project(":Fabric").name)

    implementation(project(":Fabric")) {
        transitive = false
    }
}

I have this code in my dependencies block.我的依赖项块中有这段代码。

the logger runs fine and prints out the name ('Fabric').记录器运行良好并打印出名称('Fabric')。

However, the implementation errors out with this strange error:但是,这个奇怪的错误导致实现错误:

:Test-Fabric:test: Could not find net.flytre.flytre_lib:Fabric:unspecified.
Required by:
    project :Test-Fabric

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

EDIT: It works if I build the other modules first, but then that creates a terrible dynamic of commenting and uncommenting the dependencies that is definitely not optimal.编辑:如果我先构建其他模块,它会起作用,但是这会产生一个可怕的动态,即评论和取消评论绝对不是最佳的依赖项。

Make sure to add确保添加

include 'Fabric'

inside of your settings.gradle to enable a multi-project build.在您的settings.gradle中启用多项目构建。 See here for more details.有关更多详细信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM