我有一个core
模块,它是我的应用程序的基础。该模块有 2 种风格。当我尝试在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 }
}
这是我在我的应用程序模块 build.gradle 中导入此模块的方式:
implementation project(path: ':core', configuration: 'internalRelease')