Search code examples
androidiosxcodekotlinkmm

Xcode can not Preview my KMM-App, how to solve this?


I have this Problem where Xcode can not Preview my Kotlin KMM App.

I created the App in Android Studio according to Kotlin. The Android App works and the iOS App aswell.

But the problem is im new to iOS development and Xcode. As far as I know I need Xcode to work on my iOS UI.

But as soon as I open the iOS App in Xcode, it says that the Scheme can not Build the Preview.

Here you can see the Error-Details

I already googled but couldn't find a proper solution.

The only thing I found out is that this often happens when the Project is not built correct.

Here's a Picture of my Structure: Xcode Project Structure

I hope for a quick solution because this kills the fun for me atm.


Solution

  • Unfortunately I wasn't able to fix it. So I created the project new and created it with CocoaPods Dependency Injection. After Hours I found out, that CocoaPods needs to be installed first. (Thanks for the Information Kotlin -.-) After Installing it, I was able to install the Dependencies and now I had a "Workspace" for Xcode.

    With the Workspace I was finally able to run my Code in Preview and on the Simulator as expected.

    The "How to Setup"-Tutorial from KMM could be better imo.