Search code examples
kotlin-multiplatform

KMM library build failed with e: Could not find


When building a Kotlin Multiplatform library, using CocoaPods as explained here: https://kotlinlang.org/docs/native-cocoapods.html

you may encounter the following errors:

Execution failed for task ':shared:linkPodDebugFrameworkIosArm64'.
...
Execution failed for task ':shared:linkPodDebugFrameworkIosX64'.
...
Execution failed for task ':shared:linkPodDebugFrameworkIosSimulatorArm64'.
...
Execution failed for task ':shared:linkPodReleaseFrameworkIosArm64'.
...
Execution failed for task ':shared:linkPodReleaseFrameworkIosX64'.
...
Execution failed for task ':shared:linkPodReleaseFrameworkIosSimulatorArm64'.
...

e: Could not find 'My' in [...]

What can be the cause?


Solution

  • A possible cause for this is having a white space in the Gradle project name:

    In settings.gradle.kts:

    rootProject.name = "My App"
    

    Replace it with:

    rootProject.name = "My_App"