> The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :common-libs:
* What went wrong: Could not determine the dependencies of task ':my-utils:compileDebugKotlin'. > Could not resolve all task dependencies for configuration ':my-utils:debugCompileClasspath'. > Could not resolve project :common-libs. Required by: project :my-utils > The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :common-libs: - betaDebugAndroidTestCompile - betaDebugAndroidTestRuntime - betaReleaseUnitTestRuntime .....(skip)..... - developDebugAndroidTestCompile .....(skip)..... - productionReleaseRuntime .....(skip)..... All of them match the consumer attributes: - Variant 'betaDebugAndroidTestCompile' capability My_App:common-libs:unspecified declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm': - Unmatched attributes: - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug') - Doesn't say anything about its usage (required an API) - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :common-libs' but the consumer didn't ask for it - Variant 'betaDebugAndroidTestRuntime' capability My_App:common-libs:unspecified declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm': - Unmatched attributes: - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug') - Doesn't say anything about its usage (required an API) - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :common-libs' but the consumer didn't ask for it - Variant 'betaDebugApiElements' capability My_App:common-libs:unspecified declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm': - Unmatched attributes: - Provides attribute 'com.android.build.api.attributes.VariantAttr' with value 'betaDebug' but the consumer didn't ask for it - Provides attribute 'default' with value 'beta' but the consumer didn't ask for it - Variant 'betaDebugRuntime' capability My_App:common-libs:unspecified declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm': - Unmatched attributes: - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug') - Doesn't say anything about its usage (required an API) - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :common-libs' but the consumer didn't ask for it - Variant 'betaDebugRuntimeElements' capability My_App:common-libs:unspecified declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm': - Unmatched attributes: - Provides attribute 'com.android.build.api.attributes.VariantAttr' with value 'betaDebug' but the consumer didn't ask for it - Provides attribute 'default' with value 'beta' but the consumer didn't ask for it
.....(skip).....
訊息不是很容易懂,大致上原因為 App base module 裡面定義了一些 productFlavors,但是處理 my-utils module 時找不到對應的 flavor 就爆炸了。因為我有加上 develop, beta, production 等等的 flavor,所以在 my-utils 的 build.gradle 補上這一段就可以了