我有一个core
模块,它是我的应用程序的基础。这个模块有两种口味。当我尝试在没有味道的app
模块中导入它时,我收到以下错误:
> Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
> Could not resolve project :core.
Required by:
project :app
> Project :app declares a dependency from configuration 'implementation' to configuration 'internalRelease' which is not declared in the descriptor for project :core.
这是我的核心build.gradle配置:
android {
compileSdkVersion 27
publishNonDefault true
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions 'target'
productFlavors {
internal {
dimension "target"
}
external {
dimension "target"
}
}
dexOptions { preDexLibraries true }
}
以下是我在app模块build.gradle中导入此模块的方法:
implementation project(path: ':core', configuration: 'internalRelease')