Hi there I've set up a KMP project where the iOS a...
# multiplatform
m
Hi there I've set up a KMP project where the iOS app is created using XcodeGen and the Xcode project it generates uses a different name than
iosApp
(let's say
MyProject
). With Kotlin 2.3.x, that leads to an issue, because it looks like in the Gradle plugin, the path to the Xcode project is hardcoded to `iosApp/iosApp.xcodeproj`: https://github.com/JetBrains/kotlin/blob/v2.3.0/libraries/tools/kotlin-gradle-plug[…]n/gradle/plugin/mpp/apple/CheckXcodeTargetsConfigurationTask.kt In my case, this lead to the following error when trying to sync gradle:
In plugin 'org.jetbrains.kotlin.gradle.scripting.internal.ScriptingKotlinGradleSubplugin' type 'org.jetbrains.kotlin.gradle.plugin.mpp.apple.ConvertPbxprojToJsonTask' property 'pbxprojFile' specifies file '/Users/me/Workspaces/my-kmp-project/iosApp/iosApp.xcodeproj/project.pbxproj' which doesn't exist.
If I symlink the
MyProject.xcodeproj
to
iosApp.xcodeproj
the sync works fine. Is there a gradle property I can set to change the path/name of the Xcode project? Or are we actually forced to name it
iosApp.xcodeproj
?
a
I followed this (AS Panda 3 / 2.3.20) and works for my setup (1 umbrella framework for my libraries and 3 different named xcodeproj sample apps in separate folders) https://kotlinlang.slack.com/archives/C3PQML5NU/p1769695786146389
If you have a single project only you may just be able to edit .idea/xcode.xml
(From re-reading that thread above, you should/could just be able to save as MyProject.xcworkspace from Xcode, then delete .idea/xcode.xml)? Not sure, but looks like if that is the case (it looks for any name .xcworkspace first, it won't matter what the project/folder/workspace are named.
m
I didn't even think to look in the
.idea
directory, but you're right. The
xcode.xml
File contained the wrong path. I deleted the file, reopened the project and then it recreated it with the correct path. And now it works without the symlink. Thanks a lot