Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KMM - Error Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'

I created a project to demo Kotlin Multiplatform Mobile. I built and ran it successfully on both devices: Android and iOS. After that, I re-ran the project on iOS. It had an error.

> Configure project :shared
Kotlin Multiplatform Projects are an Alpha feature. See: https://kotlinlang.org/docs/reference/evolution/components-stability.html. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.


FAILURE: Build failed with an exception.

* What went wrong:
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Command PhaseScriptExecution failed with a nonzero exit code

** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution Run\ Script /Volumes/Data/ProjectsKMM/DemoNetworkAPI/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh
(1 failure)

This is my project on Github Click here. Please see it and help me to find the error.

Thanks in advance.

like image 946
PhongBM Avatar asked Apr 29 '26 18:04

PhongBM


2 Answers

You need to use at least Kotlin 1.5.20 for embedAndSignAppleFrameworkForXcode to be available (more info in https://blog.jetbrains.com/kotlin/2021/07/multiplatform-gradle-plugin-improved-for-connecting-kmm-modules/)

like image 65
John O'Reilly Avatar answered May 01 '26 20:05

John O'Reilly


I renamed composeApp module to app_presentation so I had to fix how to run task in Xcode

Xcode settings

When I changed this line to ./gradlew :app_presentation:embedAndSignAppleFrameworkForXcode I fixed my problem

like image 42
nowiwr01p Avatar answered May 01 '26 19:05

nowiwr01p



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!