colintheshots
04/27/2023, 7:50 PMCould not resolve apps:sharedLibs:unspecified for :shared:iosArm64Main
EDIT: It looks like the issue could be that we’re importing our library project as an implementation dependency into commonMain, but as an api dependency into iosMain. This worked fine before the upgrade.
EDIT2: It appears the solution is more narrowly applying a workaround for a Gradle 8.x issue. The iOS framework tasks aren’t uniquely identifiable, so I have to add a custom attribute to make them unique. However, I cannot apply this attribute to all iOS tasks or even all iOS tasks excluding the metadata one. Here is the workaround I came up with:
// START Gradle 8.x workaround (<https://youtrack.jetbrains.com/issue/KT-55751/MPP-Gradle-Consumable-configurations-must-have-unique-attributes#focus=Comments-27-6958113.0-0>)
val attr = Attribute.of("custom.attr", String::class.java)
configurations.configureEach {
if (name.contains("FrameworkIos")) {
attributes {
attribute(attr, name)
}
}
}
// END Gradle 8.x workaround