简体   繁体   中英

Unable to build gradle that depend on other module

Hey I have many modules in my project:

starting from low level android library

  • logic

through the base android application

  • base_app

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

to the end user android application

  • 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{}

Related Questions:

android app will have following modules.

Android app module

Android Library(aar)

Android java library(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'.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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