mrm*_*tew 6 android gradle android-build-flavors dynamic-feature dynamic-delivery
我正在我正在从事的项目方面试验 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 com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Metadata' but no value provided.
- Required endpoint 'someBuildFlavor' but no value provided.
- Found org.jetbrains.kotlin.localToProject 'local to :features:myDynamicFeatureModule' but wasn't required.
- Found org.jetbrains.kotlin.platform.type 'androidJvm' but wasn't required.
- Variant ...
Run Code Online (Sandbox Code Playgroud)
请注意,此错误很长,遍历所有可能的风格。
我已经尝试过,但没有奏效:
implementation project(path: ':my-app', configuration: 'default')以及配置:'someFlavor'missingDimensionStrategy 'mydimension', 'myflavor'我尝试过并且有效:
com.android.dynamic-feature和kotlin-android笔记:
不幸的是,我无法在单独的项目中重现该问题。我尝试从我的项目中删除尽可能多的东西,但我无法解决问题。
你知道是什么导致了这个问题,我该如何解决?谢谢!
小智 2
我遇到了这个问题,这是由于没有implementation project(':features:myDynamicFeatureModule')从我的应用程序模块的 gradle 文件中删除该行。
| 归档时间: |
|
| 查看次数: |
5926 次 |
| 最近记录: |