I am updating my Android Gradle plugin
agp_version = '8.2.2'
and I have an error, that was not there with older version (was working fine with AGP 8.1.2)
Failed to resolve: io.coil-kt:coil-bom:2.5.0
The build error:
> Required by:
project :app
> No matching variant of io.coil-kt:coil-bom:2.6.0 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.AgpVersionAttr' with value '8.3.2', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:switch' with value 'cuscal', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Variant 'apiElements':
- Incompatible because this component declares a platform for use during compile-time and the consumer needed a library for use during runtime
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.3.2')
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:switch (required 'cuscal')
- 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')
Any suggestion? Thanks
With the new Gradle, I need to change
implementation "io.coil-kt:coil-bom:$coil_bom_version"
to this
implementation platform("io.coil-kt:coil-bom:$coil_bom_version")