首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >查询属性'applicationId‘的值失败

查询属性'applicationId‘的值失败
EN

Stack Overflow用户
提问于 2021-08-05 22:34:00
回答 1查看 115关注 0票数 1

我正在尝试将一个动态模块添加到我的应用程序中,但我收到以下错误。当我尝试构建它时,它会发生:

代码语言:javascript
复制
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.'''

即时通信工具使用:

代码语言:javascript
复制
Kotlin: 1.5.21
classpath("com.android.tools.build:gradle:7.1.0-alpha05")

这是我的管理模块的build.gradle

代码语言:javascript
复制
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'
}
EN

回答 1

Stack Overflow用户

发布于 2021-11-27 11:29:31

我认为你错过了,你的动态特性模块必须依赖于你的主模块。最有可能的是,动态特性的build.gradle中的以下内容会有所帮助:

implementation project(':app')

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68674197

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档