Hey :wave: I’m trying to build just the simple H...
# multiplatform
n
Hey 👋 I’m trying to build just the simple Hello World project generated by the KMM plugin in Android Studio, but I’m using the Cocoapods plugin for the first time and struggling to get the iOS project building. Within
shared/build/bin
i see that
shared.framework
seems to contain all the classes/methods I would expect But within
shared/build/cocoapods
the
shared.framework/headers
directory only contains
placeholder.h
XCode seems to recognize the shared framework alright (no warnings on the import) but it fails to resolve any of the classes within the framework Is there some task that needs running, or other automagical step, that I’m missing to link/package what’s in
build/bin
to the cocoapod output?
k
I assume you ran
pod install
?
There is a script that gets installed with cocoapods that runs some gradle when you build from Xcode
That is sometimes weird. Xcode sometimes doesn't "see" the shared module until you build and run again.
Certainly after you change Kotlin code, Xcode won't see that until you run gradle again to regen headers, and even then, it won't always right away.
n
I saw the script in shared.podspec I wasn’t sure what to make of it though. It looked like it was trying to run
:shared:syncFramework
but I don’t see that syncFramework task within the project
k
Yeah, that's a fun one. Best to not think on that too much right now
n
haha… okay simple smile
k
I would suggest running
pod install
, open the workspace, then try to build. If it fails with something about not finding the shared module, run
pod install
again
n
okay
k
This is also why I continue to plug KaMP Kit for your first attempt. You should be able to just clone and build: https://github.com/touchlab/KaMPKit/
n
I might just nuke this project and start over clean to make sure I didn’t miss anything
I’ll have to take a look at that. This is the first time in a while I’ve had real trouble getting a KMM project running. The base XCFramework approach, and the Swift Package approach have worked pretty smoothly makes me think I just did something wrong for this particular project 😅
k
Oh, weird. Yeah, I guess forget KaMP Kit. The cocoapods setup can be flakey, but it should work. I forgot you're way more experienced. Monday brain.
n
I totally Monday-brained it on my end 😅 Not sure what I did wrong the first time, but I setup a new project and this time it’s working as I expected it to
Thanks for the assist! …. now for more
k
Yeah, coffee. Monday brain is tough.
r
The
:shared:syncFramework
task only gets added to the project during an Xcode project build (it triggers on one of the environment variables that gets set there) so you won't see it in the IDEA gradle tasks list.
n
ahh. okay. Thanks @russhwolf 👍