I have this error when opening the iOS project cre...
# multiplatform
i
I have this error when opening the iOS project created with the Kotlin Multiplatform Wizard tool from JetBrains:
No such module 'ComposeApp'
Does anyone know the reason? Steps I follow: • I download the KMP project as it is by default (Android and iOS with shared UI) from this URL: https://kmp.jetbrains.com/ • I unzip the project. • I run Android, and it works. • I run iOS from Android Studio, and it gives a build error. • I open the iOS project from Xcode, and in the
ContentView.swift
class, I get the error
"No such module 'ComposeApp'"
referring to the line
import ComposeApp
. A few days ago, I created a project using the same wizard, and I had no issues. I’ve compared both projects and found no differences. I can’t explain what’s happening. I’ve repeated the process several times, cleared the caches of both Android Studio and Xcode, restarted the computer, opened Xcode first and then Android Studio... but I can’t resolve it.
s
I’d check to see the module that’s being exported for use with iOS, it should be in your build.gradle.kts — weird that it’s not working out of the box though…
🙌 1
m
Check your build.gradle and see what the shared module name is as Scott suggested. Check to make sure that this is that you are trying to import. Also-any chance you renamed your folder from composeApp (or whatever is being used in your build phases -> compile Kotlin framework step in Xcode).
🙌 1
a
i
Thank you for your responses! I’m no longer getting that error. I have no explanation as to why it was happening or why it stopped, but it must have been something related to a cache or generated file.
👍 2
p
Thanks @Iñaki Bes - I'll ask the team to check the wizard. Maybe something weird was happening
🙌 1
s
@Pamela Hill FWIW I just tried with a fresh project from the KMP wizard, works fine for Android and iOS
p
Thanks @Scott Lanoue !
👍 1