简体   繁体   English

无法构建依赖于其他模块的gradle

[英]Unable to build gradle that depend on other module

Hey I have many modules in my project: 嘿,我的项目中有很多模块:

starting from low level android library 从低级android库开始

  • logic 逻辑

through the base android application 通过基础android应用程序

  • base_app base_app

 productFlavors{ featureON{} featureOFF{} } buildTypes{ release{} debug{} } dependencies{ implementation project(':logic') } 

to the end user android application 到最终用户的android应用程序

  • client app 客户端应用

 buildTypes{ release{} debug{} } dependencies{ implementation project(':base_app') } 

ext.gradle_version = '3.4.0'

I'm getting 我越来越

ERROR: Unable to resolve dependency for ':client@debug/compileClasspath': Could not resolve project :base_app.
Show Details
Affected Modules: client

ERROR: Unable to resolve dependency for ':client@debugAndroidTest/compileClasspath': Could not resolve project :base_app.
Show Details
Affected Modules: client

ERROR: Unable to resolve dependency for ':client@debugUnitTest/compileClasspath': Could not resolve project :base_app.
Show Details
Affected Modules: client

ERROR: Unable to resolve dependency for ':client@release/compileClasspath': Could not resolve project :base_app.
Show Details
Affected Modules: client

ERROR: Unable to resolve dependency for ':client@releaseUnitTest/compileClasspath': Could not resolve project :base_app.
Show Details
Affected Modules: client

However if I use it as following 但是,如果我使用它如下

implementation project(path: ':app', configuration: 'default') 

gradle runs, but in that case changing build variant debug/release doesn't change variant in app, what I required because I want to put more productFlavors in 'client' , namely featureON{} featureOFF{} gradle运行,但在这种情况下,更改构建变量调试/发布不会更改应用程序中的变体,我需要的是因为我想在'client'中放置更多productFlavor,即featureON{} featureOFF{}

Related Questions: 相关问题:

android app will have following modules. Android应用程序将具有以下模块。

Android app module Android应用模块

Android Library(aar) Android库(aar)

Android java library(jar) Android java库(jar)

dependencies {
    implementation fileTree(include: ["*.jar"], dir: "libs")
    implementation fileTree(include: ["smack-*-${smackVersion}.jar"], dir: smackDir)
    implementation(name: "ion-${ionVersion}", ext: "aar")
}

We can not have more than one 'Android app module'. 我们不能拥有多个“Android应用模块”。

https://developer.android.com/studio/projects https://developer.android.com/studio/projects

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

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