我正在尝试将一个动态模块添加到我的应用程序中,但我收到以下错误。当我尝试构建它时,它会发生:
Execution failed for task ':admin:generateDebugBuildConfig'.
> Error while evaluating property 'applicationId' of task ':admin:generateDebugBuildConfig'
> Failed to calculate the value of task ':admin:generateDebugBuildConfig' property 'applicationId'.
> Failed to query the value of property 'applicationId'.
> Collection is empty.'''即时通信工具使用:
Kotlin: 1.5.21
classpath("com.android.tools.build:gradle:7.1.0-alpha05")这是我的管理模块的build.gradle
plugins {
id 'com.android.dynamic-feature'
id 'kotlin-android'
}
android {
compileSdk 31
defaultConfig {
applicationId "io.github.diegoflassa.admin"
minSdk 24
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.annotation:annotation:1.2.0'
}发布于 2021-11-27 11:29:31
我认为你错过了,你的动态特性模块必须依赖于你的主模块。最有可能的是,动态特性的build.gradle中的以下内容会有所帮助:
implementation project(':app')
https://stackoverflow.com/questions/68674197
复制相似问题