coil-kt / coil

Image loading for Android and Compose Multiplatform.
https://coil-kt.github.io/coil/
Apache License 2.0
10.86k stars 668 forks source link

Using Gradle 6.2: `Could not resolve io.coil-kt:coil-bom:2.2.2` #1732

Closed seanabraham closed 1 year ago

seanabraham commented 1 year ago

Describe the bug I'm unable to use the coil-bom as a platform or enforcedPlatform from Gradle 6.2. I think it's because coil-bom actually supplies Gradle Module Metadata (https://repo1.maven.org/maven2/io/coil-kt/coil-bom/2.2.2/coil-bom-2.2.2.module) which is somehow incorrect or incompatible with how Gradle 6.2 attempts to read that metadata

Logs/Screenshots Dependency Insight gives the following resolution error which explains the module metadata mapping failure:

io.coil-kt:coil-bom:2.2.2 (forced) FAILED
   Failures:
      - Could not resolve io.coil-kt:coil-bom:2.2.2.
          - Unable to find a matching variant of io.coil-kt:coil-bom:2.2.2:
              - Variant 'releaseVariantReleaseApiPublication' capability io.coil-kt:coil-bom:2.2.2:
                  - Incompatible attributes:
                      - Required org.gradle.category 'enforced-platform' and found incompatible value 'library'.
                      - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
                  - Other attributes:
                      - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided.
                      - Found org.gradle.dependency.bundling 'external' but wasn't required.
                      - Found org.gradle.libraryelements 'aar' but wasn't required.
                      - Found org.gradle.status 'release' but wasn't required.
              - Variant 'releaseVariantReleaseJavaDocPublication' capability io.coil-kt:coil-bom:2.2.2:
                  - Incompatible attribute:
                      - Required org.gradle.category 'enforced-platform' and found incompatible value 'documentation'.
                  - Other attributes:
                      - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided.
                      - Found org.gradle.dependency.bundling 'external' but wasn't required.
                      - Found org.gradle.docstype 'javadoc' but wasn't required.
                      - Found org.gradle.status 'release' but wasn't required.
                      - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
              - Variant 'releaseVariantReleaseRuntimePublication' capability io.coil-kt:coil-bom:2.2.2:
                  - Incompatible attribute:
                      - Required org.gradle.category 'enforced-platform' and found incompatible value 'library'.
                  - Other attributes:
                      - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided.
                      - Found org.gradle.dependency.bundling 'external' but wasn't required.
                      - Found org.gradle.libraryelements 'aar' but wasn't required.
                      - Found org.gradle.status 'release' but wasn't required.
                      - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
              - Variant 'releaseVariantReleaseSourcePublication' capability io.coil-kt:coil-bom:2.2.2:
                  - Incompatible attribute:
                      - Required org.gradle.category 'enforced-platform' and found incompatible value 'documentation'.
                  - Other attributes:
                      - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided.
                      - Found org.gradle.dependency.bundling 'external' but wasn't required.
                      - Found org.gradle.docstype 'sources' but wasn't required.
                      - Found org.gradle.status 'release' but wasn't required.
                      - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.

Version coil-bom 2.2.2

st4ycool commented 1 year ago

I have similar problem with coil-bom version 2.4.0 and AGP version 8.2.0-alpha13, AS version 2023.1.1 Canary 13

AdrianSilviuOlar commented 4 months ago

Same wit AGP 8.4.2: Failed to resolve: io.coil-kt:coil-bom:2.7.0

Unresolved dependencies

No matching variant of io.coil-kt:coil-bom:2.7.0 was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
  - Variant 'apiElements' capability io.coil-kt:coil-bom:2.7.0 declares a component for use during compile-time:
      - Incompatible because this component declares a platform and the consumer needed a library
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.4.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)
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
  - Variant 'enforcedApiElements' capability io.coil-kt:coil-bom-derived-enforced-platform:2.7.0 declares a component for use during compile-time:
      - Incompatible because this component declares an enforced platform and the consumer needed a library
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.4.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)
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
  - Variant 'enforcedRuntimeElements' capability io.coil-kt:coil-bom-derived-enforced-platform:2.7.0 declares a component for use during runtime:
      - Incompatible because this component declares an enforced platform and the consumer needed a library
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.4.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)
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
  - Variant 'runtimeElements' capability io.coil-kt:coil-bom:2.7.0 declares a component for use during runtime:
      - Incompatible because this component declares a platform and the consumer needed a library
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.4.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)
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')