I’ve a problem when running a KMM project on IOS s...
# multiplatform
a
I’ve a problem when running a KMM project on IOS simulator, always gives me the following error:
Copy code
** BUILD FAILED **
The following build commands failed:
	PhaseScriptExecution Run\ Script /Users/ultimate/KMMProjects/OrdersDelivery/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh (in target 'iosApp' from project 'iosApp')
(1 failure)
I think it’s a trivial issue, anyone knows what’s the cause of this problem?
p
There is a script in xcode build phases that compiles the kotlin sources before building the swift side. That script is failing, the logs don't give more info. Are you running it from xCode or AS? Are you using cocoapods?
a
I don’t use cocoapods
p
Ok, what happens when you run the gradle tasks
assembleXCFramework
?
a
I added
XCFramework
and synced, but didn’t find the
assembleXCFramework
task in the gradle tasks
p
Open and close AS/IJ clean cache, you know the typical stuff, you should see it.
Or more specific, check what task is set to run in the phase script that fails
a
Ok, I’ll try, one more question, should I add
XCFramework
stuff on each project works with regular framework to make it works on IOS?
p
The guidelines instruct you to do that, specific for xcframework. Not sure how regular frameworks works.
Have you seen a gradle task that generates a regular framework and not an xcframework?
a
After invalidate and restart AS, I tried to rebuild the project and the following error appears:
Copy code
e: Could not find "org.jetbrains.kotlin.native.platform.CoreFoundationBase" in [/Users/ultimate/KMMProjects/OrdersDelivery, /Users/ultimate/.konan/klib, /Users/ultimate/.konan/kotlin-native-prebuilt-macos-aarch64-1.7.20/klib/common, /Users/ultimate/.konan/kotlin-native-prebuilt-macos-aarch64-1.7.20/klib/platform/ios_arm64]
p
I have only seen for xcframework and cocoa
Try opening the iOS project with xCode. Ensure the kotlin multiplatform plugin is applied correctly. Give it sometime, maybe is fetching dependencies since you clear/invalidate all
a
All those steps are applied since I used multiplatform plugin when created the project
p
I see, on my experience, I use compose-multiplatform with cocoapods. There is a couple of templates that you pull from github and it just work. I would say, try to find a working template on github that best suits your needs, either kmm or compose-multiplatform and start building on top of it.
I think that is the easy way to get you started rather than following a tutorial/guideline that may be outdated with the current stage of the project
a
You’re right, Thank you for helping!
628 Views