【问题标题】:Failed to query the value of property 'applicationId'无法查询属性“applicationId”的值
【发布时间】:2021-10-10 21:53:33
【问题描述】:

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

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'
}

【问题讨论】:

    标签: android gradle build


    【解决方案1】:

    我认为您缺少动态功能模块必须依赖于您的主模块。最有可能的是,动态功能的 build.gradle 中的以下内容会有所帮助:

    implementation project(':app')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-13
      • 2021-04-23
      相关资源
      最近更新 更多