Skip to content

Cannot build the project after creating new productFlavors from new version (9.8.0~) #46

@KWONJAE

Description

@KWONJAE

When adding a non "production" productFlavor such as "internal" to the sample project, a Gradle build error occurs.
This seems to be caused by a configuration that enforces specific productFlavor values.
I suspect this may be a side effect of the "Variant Aware Dependency Resolution" introduced in version 9.8.0.
Would it be possible to adjust this behavior?

  • What I changed in the sample project
    Image

  • Error logs

Execution failed for task ':checkInternalDebugAarMetadata'.
> Could not resolve all files for configuration ':internalDebugRuntimeClasspath'.
   > Could not resolve com.chartboost:chartboost-sdk:9.9.3.
     Required by:
         project :
      > No matching variant of com.chartboost:chartboost-sdk:9.9.3 was found. The consumer was configured to find a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:version' with value 'internal', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.2.2' but:
          - Variant 'productionReleaseApiElements-published' capability com.chartboost:chartboost-sdk:9.9.3 declares a library:
              - Incompatible because this component declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.ProductFlavor:version' with value 'production' and the consumer needed a component for use during runtime, as well as attribute 'com.android.build.api.attributes.ProductFlavor:version' with value 'internal'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
          - Variant 'productionReleaseRuntimeElements-published' capability com.chartboost:chartboost-sdk:9.9.3 declares a library for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.ProductFlavor:version' with value 'production' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.ProductFlavor:version' with value 'internal'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
          - Variant 'productionReleaseSourcesElements-published' capability com.chartboost:chartboost-sdk:9.9.3 declares a component for use during runtime:
              - Incompatible because this component declares documentation, as well as attribute 'com.android.build.api.attributes.ProductFlavor:version' with value 'production' and the consumer needed a library, as well as attribute 'com.android.build.api.attributes.ProductFlavor:version' with value 'internal'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions