Hi there, we have one special usecase in one of ou...
# multiplatform
s
Hi there, we have one special usecase in one of our multi modular KMM project attached folder SS, when started the project we used
pitaraShared
as entry point for both ios & android now we want to introduce
entryshared
as entry for ios & android, we are able to update the
entryShared
as entry screen in android but in iOS we tried updating in places attached screen but still no luck, we are seeing
no entryShared module found in case of iOS
, Can someone help to check or is this limitation?
hi @Elijah Semyonov anything on this
I think we got it. We need to add entryShared in run script path, as shown in the screen shot
👍 1
Btw is it possible to run two modules by linking to iOS app? as shown below?. As we are trying to create product by using this architecture, wherein we want to export(.framework/.aar) independent features(pitara, battleground, xyz) module directly from gradle tasks. from entryShared we also want to export clubbed (.aar/framework) Is this possible?
y
It depends if your Kotlin generated framework is a dynamic framework or a static framework. We use static framework which makes this tricky as you would have duplicate symbols for Kotlin stdlib. Every kotlin framework would be exporting things like
KotlinInt
,
KotlinBool
...etc and any shared module is also exported twice so types are incompatible. Some of these problems go away with dynamic frameworks but I think shared types will still be incompatible. In theory you can get by without passing objects between modules but it's annoying to work around.
s
Using staticframework is the approach we are trying but as you said duplicate symbols we are seeing the issue. How can we tell the iOS compiler to use one of this ?? In case of android gradle does it automatically
y
You use dynamic frameworks but as I mentioned will come with a different set of challenges. Your best approach is to create a parent module for iOS only that depends on your other independent modules and exports what's needed to iOS. i.e. iosApp (Xcode project) -> iOSLib (Gradle module) -> shared-module-a -> shared-module-b ...etc So it becomes similar to how your androidApp (Gradle module) depends on all the other modules.
👍 1
s
While using multimodular approach in KMM, I have introduced the entryshared module successfully as attached ss above, and now I am exporting the framework from entryshared and trying to use in native iOS app. But started seeing issue while opening the feature of pitara. Btw Im able to compile and use all the classes in native ios app but when we try to open screen of pitaraShared in native ios app, it crashes saying
Copy code
Uncaught Kotlin exception: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: /private/var/containers/Bundle/Application/BFEF3A66-4DDD-47CC-AC99-62F8851B89C3/PhysicsWallah.app/compose-resources/composeResources/live.pw.pitarashared.generated.resources/values/strings.commonMain.cvr
    at 0   entryShared                         0x1123be88b        kfun:org.jetbrains.compose.resources.MissingResourceException#<init>(kotlin.String){} + 123 
    at 1   entryShared                         0x1123c915b        kfun:org.jetbrains.compose.resources.object-2.readPart#internal + 3423 
    at 2   entryShared                         0x1123c00bf        kfun:org.jetbrains.compose.resources.$getStringItem$lambda$0COROUTINE$0.invokeSuspend#internal + 431
Can someone help to check cc : @Elijah Semyonov
this is project structure,
to simply the question entryShared using pitarashared and generating framework from entryshared to use in native ios app when I compile and try access one of the screen of pitarashared in native ios app crash's with above log
e
Multimodules and resources are not my area of expertise. If you think it’s a bug - please use Compose YouTrack.
👍 1