小编mrm*_*tew的帖子

无法在以下项目变体之间进行选择 :features:myDynamicFeatureModule:

我正在我正在从事的项目方面试验 Android 的动态功能模块(又名按需模块)。

在我的 PoC(概念验证)项目中,动态功能模块 (DFM) 工作正常,gradle 可以毫无问题地构建项目。在完成我的 PoC 之后,我决定将其应用于现有项目。但是,gradle 无法通过以下方式构建项目:

Could not determine the dependencies of task ':my-app:checkSomeBuildFlavorDebugLibraries'.

> Could not resolve all task dependencies for configuration ':my-app:someBuildFlavorDebugMetadataValues'.
   > Could not resolve project :features:myDynamicFeatureModule.
     Required by:
         project :my-app
      > Cannot choose between the following variants of project :features:myDynamicFeatureModule:
          - anotherBuildFlavorDebugAndroidTestCompile
          - anotherBuildFlavorDebugAndroidTestRuntime
          - ...
        All of them match the consumer attributes:

          - Variant 'anotherBuildFlavorDebugAndroidTestCompile' capability myproject.features:myDynamicFeatureModule:unspecified:
              - Unmatched attributes:
                  - Required com.android.build.api.attributes.BuildTypeAttr 'debug' but no value provided.
                  - Required …
Run Code Online (Sandbox Code Playgroud)

android gradle android-build-flavors dynamic-feature dynamic-delivery

6
推荐指数
1
解决办法
5926
查看次数