我有一个名为
我在Stack Overflow上看到一些问题,比如这里,说要将库模块的flavor复制到主应用程序模块,但这对我来说没有意义,
library
的库模块,它有两种flavor flavor1
和flavor2
。然后我有两个应用程序模块,让我们称它们为app1
和app2
,它们将使用此库模块,每个应用程序将使用特定的flavor..例如,app1
将始终使用带有flavor1
风格的library
。我应该如何配置gradle依赖项才能实现我想要的效果?如果我只在app1
build.gradle
中尝试implementation project(':library')
,显然不起作用,因为它不知道选择哪个flavor..所以我尝试了一些类似implementation project(path: ':library', configuration: 'flavor1Release')
这样的东西,但也不起作用,它打印出很多错误。ERROR: Unable to resolve dependency for ':app1@debug/compileClasspath': Could not resolve project :library.
Show Details
Affected Modules: app1
ERROR: Unable to resolve dependency for ':app1@debugAndroidTest/compileClasspath': Could not resolve project :library.
Show Details
Affected Modules: app1
ERROR: Unable to resolve dependency for ':app1@debugUnitTest/compileClasspath': Could not resolve project :library.
Show Details
Affected Modules: app1
ERROR: Unable to resolve dependency for ':app1@release/compileClasspath': Could not resolve project :library.
Show Details
Affected Modules: app1
ERROR: Unable to resolve dependency for ':app1@releaseUnitTest/compileClasspath': Could not resolve project :library.
Show Details
Affected Modules: app1
我在Stack Overflow上看到一些问题,比如这里,说要将库模块的flavor复制到主应用程序模块,但这对我来说没有意义,
app1
不知道任何关于flavor2
的事情,我不想在那里引入它。