Hey folks, do you know what are my options to debu...
# multiplatform
m
Hey folks, do you know what are my options to debug this issue with KMM?
Copy code
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':ipInfo'.
Currently it works perfectly on local machines but fails on CI. But I am experiencing this issue every now and then and would like to learn some tricks how to get to the bottom of the issue. Any ideas?
r
That’s likely caused by some missing Xcode environment variables. What Kotlin version are you using?
m
So in the end it was missing
baseName
or
target architecture
(iPhoneSimulator). But I would still want to know where to find logs or what can I debug to see that it is indeed that - if you know what I mean 🙂
r
In a recent Kotlin version (not quite sure which one) the error messages were improved. Though I am not sure if those 2 cases are covered. Anyway as part of the improvement the task will always be registered and should display an error message in case of missing environment variables.
m
nice - that sounds like a lot of improvement actually even knowing that something went wrong and that is why it was not registered is great I am on 1.6.21 but just upgrading to 1.7.10, so looking forward to my next interaction with this issue 🙂
r
m
that’s a shame then because it didn’t help in my case 😞 hope there was an improvement in recent versions
r
IIUC the "not found" error will only occure non of the targets have a binary framework configured.
So I guess that would be the
baseName
in your case.
m
Copy code
targets.withType(KotlinNativeTarget::class).getByName(
            when {
                System.getenv("SDK_NAME")?.startsWith("iphoneos") == true -> "iosArm64"
                System.getenv("NATIVE_ARCH")?.startsWith("arm") == true -> "iosSimulatorArm64"
                else -> "iosX64"
            }
        ) {
            binaries {
                framework {
                    baseName = project.name
                }
            }
        }
what helped for reference (the problem with CI was that I was not using it there 🤦)
m
Copy code
KotlinNativeTarget with name 'iosX64' not found.
in my parts 😞
r
@miqbaldc you should add the target:
Copy code
kotlin {
    iosX64()
}
m
Done, thanks, the task now available, unfortunately the swift compile error happened afterwards: https://kotlinlang.slack.com/archives/C3PQML5NU/p1661584594602739?thread_ts=1661584594.602739&cid=C3PQML5NU