android - 错误 : configuration 'implementation' to configuration 'internalRelease' is not declared in the descriptor for project

标签 android android-gradle-plugin build.gradle android-productflavors android-build-flavors

我有一个 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')

最佳答案

尝试简单地使用 implementation project(':core') 参见链接 here

关于android - 错误 : configuration 'implementation' to configuration 'internalRelease' is not declared in the descriptor for project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50860516/

相关文章:

java.lang.ClassNotFoundException : com. game.mrnom.MrNomGame 加载器 dalvik.system.PathClassLoader [/data/app/com.game.mrnom-1.apk]

android - 创建一个具有多个aar文件作为依赖项的aar

android - 由于 gradle 问题,React Native 演示项目失败

android-studio - 无法构建 android apk 错误 : ZipException: duplicate entry: org/objectweb/asm/AnnotationVisitor. 类

java - 错误:任务 ':app:dexDebug'的执行失败。 > com.android.ide.common.process.ProcessException:

android - Android 4.1 使用 Phonegap 加载外部 html 的问题

android - 应用已关闭但音乐仍在播放

android - 我无法在运行时权限中显示 Manifest.permission.CALL_PHONE

android - 在新的 Android Studio 中使用 OpenCL

gradle - 通过 maven-publish 在 gradle 中设置凭据