Android 子module添加渠道配置异常

项目导入一个module编译出现如下错误:

	The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:1.0' with value 'test1', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :test_sdk:
	          - test1DebugRuntimeElements
	          - test2DebugRuntimeElements
	          - test3DebugRuntimeElements
	        All of them match the consumer attributes:
	          - Variant 'test1DebugRuntimeElements' capability Health:health_sdk:unspecified declares a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
	              - Unmatched attributes:
	                  - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:1.0 (required 'test2')
	                  - Provides attribute 'com.android.build.api.attributes.ProductFlavor:default' with value 'test1' but the consumer didn't ask for it
	                  - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'test1Debug' but the consumer didn't ask for it
	                  - Provides attribute 'default' with value 'test1' but the consumer didn't ask for it
	                  - Provides a library but the consumer didn't ask for it

检查后发现是主module和子module的flavorDimensions配置不一致导致,flavorDimensions允许你在定义多个产品风味时,将它们分组到不同的维度中。这样可以使得每个产品风味只能选择一个维度进行组合,而不会出现混乱或冲突的情况。

相关推荐

  1. Android module添加渠道配置异常

    2024-03-30 04:38:02       32 阅读
  2. android studio中添加module依赖

    2024-03-30 04:38:02       34 阅读
  3. android studio导入module

    2024-03-30 04:38:02       58 阅读
  4. Android】动态添加 Fragment

    2024-03-30 04:38:02       60 阅读
  5. Android 10.0 展讯平台系统添加公共so库的配置方法

    2024-03-30 04:38:02       49 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-30 04:38:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-30 04:38:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-30 04:38:02       82 阅读
  4. Python语言-面向对象

    2024-03-30 04:38:02       91 阅读

热门阅读

  1. 什么是对冲?

    2024-03-30 04:38:02       46 阅读
  2. (vue)判断是否为字符串/数组

    2024-03-30 04:38:02       33 阅读
  3. Mojo官方例子|可直接notebook运行

    2024-03-30 04:38:02       47 阅读
  4. 皮卡丘python写leetcode

    2024-03-30 04:38:02       36 阅读
  5. pathlib标准库

    2024-03-30 04:38:02       43 阅读
  6. C/C++ 一些使用网站收集...

    2024-03-30 04:38:02       42 阅读