我正在研究多种口味app
。(下面的gradle文件)
它使用一个名为的库tracker
,遵循相同的风格internal
和external
现在对于棘手的部分,来一个名为 的新模块feature
,这个模块没有味道,但它需要tracker
as 依赖
应用程序.gradle:
android {
buildTypes {
debug {
}
release {
}
}
flavorDimensions "target"
productFlavors {
internal {
dimension "target"
}
external {
dimension "target"
}
}
}
跟踪器.gradle:
android {
publishNonDefault true
buildTypes {
release {
}
debug {
}
}
flavorDimensions 'target'
productFlavors {
internal {
dimension "target"
}
external {
dimension "target"
}
}
}
特征.gradle:
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
}
}
dependencies {
implementation(
[...]
project(':tracker')
)
}
这是errors
我尝试gradle sync的时间:
Unable to resolve dependency for ':feature@debug/compileClasspath': Could not resolve project :tracker.
Could not resolve project :tracker.
Required by:
project :feature
> Project :feature declares a dependency from configuration 'implementation' to configuration 'externalRelease' which is not declared in the descriptor for project :tracker.
Unable to resolve dependency for ':feature@debugAndroidTest/compileClasspath': Could not resolve project :tracker.
Could not resolve project :tracker.
[...]