Hello, I am facing problem integrating KMM-ViewMod...
# multiplatform
a
Hello, I am facing problem integrating KMM-ViewModel in my project. I have created the project using Jetbrains web wizard and trying to integrate the KMM-ViewModel library to share my VM in android and iOS. Android is working fine but iOS build is failing with error saying unknown reference KMMViewModelSwiftUI in import section of iOS code. I have added the library for iOS using Xcode as said here https://github.com/rickclephas/KMM-ViewModel#swift like File->Add packages I am using xcode 15 Any help is appreciated
r
Hi. Could you verify that
KMMViewModelSwiftUI
is added to the "Frameworks, Libraries, and Embedded Content" section in the general settings of your app target?
a
Hello @Rick Clephas, Thank you so much for your response >
KMMViewModelSwiftUI
is added to the "Frameworks, Libraries, and Embedded Content" section in the general settings of your app target? No, they are not. But they are added as package dependency in project settings
Screenshot 2023-12-24 at 19.17.36.png,Screenshot 2023-12-24 at 19.19.07.png
r
Alright normally when you add the package as a dependency one of the last steps will add the frameworks to the app target. Please try adding
KMMViewModelSwiftUI
to the frameworks section of your app target. It should be listed when you click the + sign.
a
Yeah, it should. But it is not in Xcode 15. And I tried multiple times to add it with the plus sign but unable to add it. I’m wondering whether it is Xcode 15 problem or am I missing something
r
Do you get any kind of error when trying to add the framework to the target?
a
No. It gives just nothing. Now I’m trying to add it using Xcode 14, but still can't
Screenshot 2023-12-24 at 20.45.53.png
r
I believe the URL should end in
.git
as in
<https://github.com/rickclephas/KMM-ViewModel.git|https://github.com/rickclephas/KMM-ViewModel.git>
a
Yeah, definitely. I added it with .git but as it’s not working, so removed .git part to try. As I’m trying various ways
Don't know where is the problem. But for investigating it more, today I have created another project with Android Studio (in my office PC), and tried to integrate the library and voila! It worked. But it’s still not working with the previous project (Which was created using Web Wizard of JetBrains). Thanks for your response ☺️ As it's working with the project created by AS, I will try to move the code to that project. Now it's solved for me.
👍 1