Hii team, I have updated my android project to kot...
# multiplatform
s
Hii team, I have updated my android project to kotlin 2.0 and I am able to build and run my project for android but there is a KMM module which we publish to be consumed for the iOS project. When I build that particular module using command ./gradlew build it is showing me some error. Can anyone help me here ? Also I want add here that I have upgraded my
SKIE
library also from
0.6.1
to
0.8.0
to transition from kotlin
1.9.22
to kotlin
2.0.0
I am pasting my error here:
Copy code
/Users/shubham.singh/StudioProjects/littleGreenMen2/umbrella/build/skie/binaries/podDebugFramework/DEBUG/iosArm64/cache/kotlin-framework/KMMUmbrella.framework/Headers/KMMUmbrella.h:21995:9: error: 'CoreTelephony/CoreTelephony.h' file not found
#import <CoreTelephony/CoreTelephony.h>
        ^
/Users/shubham.singh/StudioProjects/littleGreenMen2/umbrella/build/skie/binaries/podDebugFramework/DEBUG/iosArm64/cache/kotlin-framework/KMMUmbrella.framework/Headers/KMMUmbrella.h:21995:9: note: did not find header 'CoreTelephony.h' in framework 'CoreTelephony' (loaded from '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.2.sdk/System/Library/Frameworks')
#import <CoreTelephony/CoreTelephony.h>
        ^
<unknown>:0: error: could not build Objective-C module 'KMMUmbrella'
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/KMMUmbrella.h"
        ^
/Users/shubham.singh/StudioProjects/littleGreenMen2/umbrella/build/skie/binaries/podDebugFramework/DEBUG/iosArm64/cache/kotlin-framework/KMMUmbrella.framework/Headers/KMMUmbrella.h:21995:9: error: 'CoreTelephony/CoreTelephony.h' file not found
#import <CoreTelephony/CoreTelephony.h>
        ^
/Users/shubham.singh/StudioProjects/littleGreenMen2/umbrella/build/skie/binaries/podDebugFramework/DEBUG/iosArm64/cache/kotlin-framework/KMMUmbrella.framework/Headers/KMMUmbrella.h:21995:9: note: did not find header 'CoreTelephony.h' in framework 'CoreTelephony' (loaded from '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.2.sdk/System/Library/Frameworks')
#import <CoreTelephony/CoreTelephony.h>
        ^
<unknown>:0: error: could not build Objective-C module 'KMMUmbrella'
error: fatalError
        at co.touchlab.skie.util.Command.handleExitCode(Command.kt:102)
        at co.touchlab.skie.util.Command.execute(Command.kt:85)
        at co.touchlab.skie.util.Command.execute$default(Command.kt:57)
        at co.touchlab.skie.phases.swift.CompileSwiftPhase.callSwiftCompiler(CompileSwiftPhase.kt:135)
        at co.touchlab.skie.phases.swift.CompileSwiftPhase.execute(CompileSwiftPhase.kt:41)
        at co.touchlab.skie.phases.swift.CompileSwiftPhase.execute(CompileSwiftPhase.kt:10)
        at co.touchlab.skie.phases.util.SkiePhaseGroup.execute$kotlin_compiler_core(SkiePhaseGroup.kt:26)
        at co.touchlab.skie.phases.util.SkiePhaseGroup$execute$1.invokeSuspend(SkiePhaseGroup.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
👀 1
🧵 2
Hii @Alejandro Rios , What could be the issue ?
i
Just go back to 1.9.22
🫠 2
t
Hi, I'll take a look and try to reproduce it in SKIE, will keep you updated.
@Shubham Singh Could you share what class from
CoreTelephony
do you use in your Kotlin code?
s
Hi @Tadeas Kriz Will check with the iOS team first then only can revert you back.
c
Also @Shubham Singh, Cross-posting without reference in not a good thing and posting long code snippets in the channel as well.
t
This is a bug in SKIE, we'll fix it in the next patch release
s
Hi @Tadeas Kriz can you send me some reference from where you find out that this is a bug ?
Hii @Chrimaeon I am new to Kotlin Slack and I am sorry if my long message caused any harm
👍 1
t
@Shubham Singh I tested class from
CoreTelephony
in our SKIE playground and I was able to reproduce it. The problem is that with SKIE 0.8.0, we stopped generating fake frameworks for system SDKs. However, the code handling it is supposed to be replaced in the future, so we made it simple. And that simplicity expected all system frameworks to declare an umbrella header, which some of them don't.
s
Can we declare an umbrella header from our side ? @Tadeas Kriz
Due to this only issue I am unable to migrate my android project to Kotlin 2.0.0 😞 . When are we supposed to get a patch for this @Tadeas Kriz ?
t
Since you're the first who reported it, I'm currently looking into it.
s
Okay @Tadeas Kriz, Please keep in touch and do revert when you are done with the fix. Please answer my this question:
Can we declare an umbrella header from our side ?
t
Not sure, but even if you could it'd require deep knowledge
You can try SKIE
0.7.2-preview.2.0.0-RC3
in the meantime
s
Is this
SKIE
0.7.2-preview.2.0.0-RC3
supports kotlin
2.0.0
version
??
@Tadeas Kriz
t
It might, you'll need to override SKIE's KGP version by putting
skie.kgpVersion=2.0.0
in your
gradle.properties
s
Okay trying @Tadeas Kriz
See @Tadeas Kriz. I think it will not work for my umbrella module.
t
Oh yeah, forgot how it works, should be
skie.kgpVersion=2.0.0-RC3
s
Hi @Tadeas Kriz, It worked !! 💯🥳
Thanks for your help but please release a fix in 0.8.0 version also.
As this is the warning that I am getting every time 🙃
@Tadeas Kriz
t
Yeah, you're supposed to be getting the warning
It's only to get you unblocked until a fix is released
🙌 1
s
When are we fixing it ?
t
Who knows
s
Means till then I'll have to bear with the preview-version only ? @Tadeas Kriz
t
When it's out, it's out
s
Okay, Thanks
Hi @Tadeas Kriz
We are still facing some issues as I checked with my ios team.
We are not getting NativeKt methods after publishing through this preview version of
SKIE
So eventually we are unable to consume that published KMM module in iOS project.
Hi @Tabrez , can you provide more details here ?
t
Hi Tadeas, There was a error of core-telephony.h file not found. Thank you for sending
SKIE
version :
0.7.2-preview.2.0.0-RC3
i see the framework is getting generated now. We also use https://github.com/rickclephas/KMP-NativeCoroutines for observing flows in KMP, it used to generate class functions with
NativeKT
syntax. it's broken in this version and it's not generating extension fuctions for KMP model functions. e:g
Copy code
extension RandomLettersGenerator {
    func getRandomLetters() -> NativeSuspend<String, Error, KotlinUnit> {
        RandomLettersGeneratorNativeKt.getRandomLetters(self)
    }
}
i'll try checking it and updating there library if there is a new version available. and update it here.
Hi Tadeas, We updated library https://github.com/rickclephas/KMP-NativeCoroutines to v1.0.0-ALPHA-31 it's working fine with this. they have added support for Kotlin 2.0 and we are getting extension functions with NativeKT syntax.. Thanks for you help.
t
❤️ 1
t
@Tadeas Kriz Thank you so much.