Open RageshAntony opened 1 year ago
When you run build in xCode, LoginViewModelActionKs generated, but you need add it in xCode project manually. This step not described in article, and for newbies it might be confusion.
1) Build project in xCode and getting error Cannot find 'LoginViewModelActionKs' in scope, at this step xCode generate all necessary code from Kotlin
2) Add new group to xCode project an call it kswift
3) In new group add files to project
4) Find generated swift file in this route (In your case name of file will be < projectName >_shared.swift)
5) Your project tree should be look like this
Now build your project again and your application will be stated in emulator, don't forget choose right form the list.
@kxxb
I took the latest version of this repo and I am getting two errors in xcode:
error: Build input file cannot be found: '/moko-mvvm-compose-swiftui/shared/build/cocoapods/framework/MultiPlatformLibrarySwift/mvvm-compose-swiftui_shared.swift' (in target 'iosApp' from project 'iosApp')
/moko-mvvm-compose-swiftui/iosApp/iosApp/LoginScreen.swift:11:8: No such module 'mokoMvvmFlowSwiftUI'
and I see no file called kswift_shared.swift in the folder you mentioned above so I don't really understand what is going on here :|
this is how my project looks in xcode:
@kxxb
Awesome. Thanks. Working now.
Thanks for your detailed answer with images 💕💕
ok, I think I managed to fix it by opening the iosApp.xcworkspace in XCode instead of the iosApp.xcodeproj, building one time -> failed but all the files are generated and then the second time the app starts
Why LoginViewModelActionKs is not generated ? I am getting
Cannot find 'LoginViewModelActionKs' in scope
My gradle files:
project gradle
shared module gradle
please help me