https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
k

Khudoyshukur Juraev

12/01/2023, 11:07 AM
Hello. I am new here. I am working on a kmm project and encountered a problem. Please help me. https://stackoverflow.com/questions/77584346/kmm-cant-run-app-in-ios-simulator-app-uses-cocoapods-dependency
p

Pablichjenkov

12/01/2023, 12:44 PM
I think the problem may be related to that framework not having support for emulators. Could you confirm it has support for it?
k

Khudoyshukur Juraev

12/01/2023, 12:46 PM
The library is in swift. But, I am able to use it in code: ////// import cocoapods.TwilioConversations.TCHConversation //////
Screenshot 2023-12-01 at 5.47.48 PM.png
Also it should have support for simulator
I am following exactly the same with the documentation but not getting results
p

Pablichjenkov

12/01/2023, 12:49 PM
What if you run it from xCode?
k

Khudoyshukur Juraev

12/01/2023, 12:49 PM
It is not for TwilioConversations If I simply add "JSONModel" pod, it shows the same error
p

Pablichjenkov

12/01/2023, 12:50 PM
Humm I see, are you building from Android Studio or Xcode?
k

Khudoyshukur Juraev

12/01/2023, 12:50 PM
Yes, tried running with Xcode also. Same error. Also tried running on Rosetta (Because I use M1 chip). But did not work
p

Pablichjenkov

12/01/2023, 12:50 PM
Ah ok
k

Khudoyshukur Juraev

12/01/2023, 12:50 PM
Both AS and XCOde
p

Pablichjenkov

12/01/2023, 12:52 PM
I first thought that the swift Interoperability could be the issue but as you said you have visibility of it.
However, the official documentation said something about swift pure libraries.
k

Khudoyshukur Juraev

12/01/2023, 12:54 PM
I also thought about it. If other libs work and only Twilio did not work, I could conclude this is related to pure swift. But I am unable to run with 'JSONModel' pod according to docs.
image.png
p

Pablichjenkov

12/01/2023, 12:58 PM
That's right. I am trying to find a section I saw with common issues when using cocoapods but don't see it now
b

brandonmcansh

12/01/2023, 1:28 PM
Did you close Xcode and open the xcworkspace instead?
You also need to update AS run configuration to use it as well over the xcodeproj
k

Khudoyshukur Juraev

12/01/2023, 1:31 PM
image.png
Do you mean opening like this?
@brandonmcansh
b

brandonmcansh

12/01/2023, 1:32 PM
Yes.
That’s the file you use with cocoapods
k

Khudoyshukur Juraev

12/01/2023, 1:33 PM
image.png
Blank
b

brandonmcansh

12/01/2023, 1:33 PM
Did you run pod install in the iosapp directory?
Close Xcode
In terminal in the iosapp directory, run
Copy code
pod deintegrate
rm -rf Podfile.lock
pod install
Then reopen the workspace
k

Khudoyshukur Juraev

12/01/2023, 8:26 PM
@brandonmcansh I sample project from template. And tried adding same dependencies. Encountered the same problems. And did what you said:
Did you close Xcode and open the xcworkspace instead?
Now it is running 🤝
b

brandonmcansh

12/01/2023, 8:38 PM
so you're up and running?
k

Khudoyshukur Juraev

12/01/2023, 8:40 PM
Yes, project is working. I was just testing the idea of 'integrating twilio conversations sdk' to kmm.
b

brandonmcansh

12/01/2023, 8:41 PM
good. when switching to cocoapods the project changes so gets a little different in terms of setup
k

Khudoyshukur Juraev

12/01/2023, 8:41 PM
But still did not understand why AS is failing to run the app
b

brandonmcansh

12/01/2023, 8:41 PM
need to switch the run configuration
delete the existing iosApp one and make a new one and pick the xcworkspace file instead of the proj file
👍 1
k

Khudoyshukur Juraev

12/01/2023, 8:42 PM
ok, understood
7 Views