https://kotlinlang.org logo
Title
s

Stefan Oltmann

04/15/2023, 6:47 AM
After upgrading to Gradle 8.1 (from 7.X) I got
Consumable configurations with identical capabilities within a project (other than the default configuration) must have unique attributes, but configuration ':shared:releaseFrameworkIosFat' and [configuration ':shared:releaseFrameworkIosArm64'] contain identical attribute sets. Consider adding an additional attribute to one of the configurations to disambiguate them.
I fail to understand where this does come from and what I should do. This is part of the configuration in `shared`:
listOf(
    /* App Store */
    iosArm64(),
    /* Apple Silicon iOS Simulator */
    iosSimulatorArm64(),
    /* Intel macOS Devices */
    macosX64()
).forEach {

    it.binaries.framework(
        buildTypes = setOf(NativeBuildType.RELEASE)
    ) {
        baseName = "shared"
        /* Bitcode was deprecated with XCode 14 */
        embedBitcode("disable")
        /* Exported dependencies */
        export("com.appmattus.crypto:cryptohash:${Versions.cryptoHash}")
    }
}

    val iosArm64Main by sourceSets.getting
    val iosSimulatorArm64Main by sourceSets.getting
    val macosX64Main by sourceSets.getting
//    val macosArm64Main by sourceSets.getting

    @Suppress("UnusedPrivateMember", "UNUSED_VARIABLE") // False positive
    val appleMain by sourceSets.creating {

        iosArm64Main.dependsOn(this)
        iosSimulatorArm64Main.dependsOn(this)
        macosX64Main.dependsOn(this)
//        macosArm64Main.dependsOn(this)

        dependencies {

            // Networking
            api("io.ktor:ktor-client-ios:${Versions.ktor}")

            // Database
            api("com.squareup.sqldelight:native-driver:${Versions.sqlDelight}")
        }
    }
Reducing it to this does not change anything:
listOf(
    /* App Store */
    iosArm64(),
    /* Apple Silicon iOS Simulator */
    iosSimulatorArm64(),
    /* Intel macOS Devices */
    macosX64()
).forEach {

    it.binaries.framework {
        baseName = "shared"
    }
}
h

hfhbd

04/15/2023, 6:56 AM
https://youtrack.jetbrains.com/issue/KT-55751/MPP-Gradle-Consumable-configurations-must-have-unique-attributes
val dummy = Attribute.of("dummy", String::class.java)
listOf(
    /* App Store */
    iosArm64 {
     attributes.attribute(dummy, "KT-55751")
    },
    /* Apple Silicon iOS Simulator */
    iosSimulatorArm64(),
    /* Intel macOS Devices */
    macosX64()
).forEach {

    it.binaries.framework {
        baseName = "shared"
    }
}
That's enough
s

Stefan Oltmann

04/15/2023, 7:32 AM
Thank you 🙏