我正在使用这种新的模块类型,我想知道是否可以在目录中使用它。因此,我以“ ui”目录内的“ home”模块为例,并得到以下错误:
ERROR: Unable to find matching projects for Dynamic Features: [:ui:home]. Affected Modules: app
但是gradle将其他模块作为子模块没有问题,所以我认为问题可能是动态功能所特有的
这是“应用程序”模块的优点:
.
.
.
android {
compileSdkVersion AppMetaData.compileSdkVersion
defaultConfig {
applicationId AppMetaData.id
minSdkVersion AppMetaData.minSdkVersion
targetSdkVersion AppMetaData.targetSdkVersion
versionCode AppMetaData.versionCode
versionName AppMetaData.versionName
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
buildConfigField "boolean", "DEBUG_LOGS", "true"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dynamicFeatures = [Modules.home]
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(Modules.common)
implementation project(Modules.domain)
implementation project(Modules.navigation)
implementation project(Modules.network)
implementation project(Modules.persistence)
.
.
.
}
object Modules {
const val app = ":app"
const val common = ":common"
const val domain = ":core:domain"
const val navigation = ":ui:navigation"
const val network = ":core:network"
const val persistence = ":core:persistence"
// Dynamics
const val home = ":ui:home"
}