I just updated our KMM Android/iOS project to Andr...
# multiplatform
c
I just updated our KMM Android/iOS project to Android Gradle Plugin 8.0. But now I’m getting errors that our shared KMP libraries cannot see one another to import from the other library projects. Does something need to change in the multiplatform Gradle configuration to support Gradle 8.0? (I don’t have any module named “unspecified”)
Copy code
Could 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:
Copy code
// 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