Hi, I have problems getting DefaultComponentContex...
# decompose
j
Hi, I have problems getting DefaultComponentContext(...) on iOS: + I am using cocoapods + in commonMain:
Copy code
api(libs.decompose)
api(libs.essenty.lifecycle)
+ in cocoapods:
Copy code
export(libs.decompose)
 export(libs.essenty.lifecycle)
 transitiveExport = false
 isStatic = true
+ in iOSApp.swift
Copy code
DefaultComponentContext(lifecycle: lifecycle)
=> cannot find 'DefaultComponentContext' in scope Any idea?
a
This looks similar to another question that was asked on GitHub. I never used cocoapods, maybe someone here could help? At the moment this looks like a generic KMP problem, Decompose library shouldn't be different from any other library in this regard. Maybe worth asking in #multiplatform.
j
ok, I will keep trying and let you know If I resolved that issue. Will update githup as well.
yes, I can confirm its breaking if I add this to commonMain:
Copy code
// Version Decompose: 2.0.0-alpha-02
// Version Decompose-Extensions: 2.0.0-compose-experimental-alpha-01
// Module: com.arkivanov.decompose:extensions-compose-jetbrains
implementation(libs.decompose.extensions.jetbrains)
a
Can you try using the same version across all decompose modules? Either normal one or experimental.
j
hm ...
Copy code
Could not resolve all dependencies for configuration ':gs_api_multiplatform:iosArm64CompileKlibraries'.
   > Could not resolve com.arkivanov.decompose:extensions-compose-jetbrains:2.0.0-alpha-02.
ok, have to go now. Will have a look tomorrow again ... thanks for help
a
If you need compose for iOS, then please use the experimental version for everything.
a
Hello, good day folks. I reported issue on the Github link shared. I have tried downgrading library and kotlin versions, tried different combinations, but they all produce some new error and didn't work. May be because Ia m using AS Flamingo. Therefore I reverted back to latest update, and facing same issue again. In the source code, I can see
DefaultComponentContext
inside
DefaultComponentContextBuilderKt
. Also, it is declared as a class in
DefaultComponentContext
. I am not a KMM pro, just thinking why all the classed declared in here are not accessible from xcode. Is it because of kotlin 1.8.20, KMM's cocoapods support or anything else? Is there something we can do to debug? I really wanted to use this library 🌟
The last resort I can think of is to disintegrate cocoapods and try with regular. But I really don't know if it's cocoapod support issue from KMM
a
Maybe try asking in #multiplatform channel?
Also please make sure you are using the same version for every Decompose dependency (e.g. decompose and extensions-compose-jetbrains must have the same version)
a
yes, it's same.
Copy code
api("com.arkivanov.decompose:decompose:2.0.0-alpha-02")
api("com.arkivanov.decompose:extensions-compose-jetbrains:2.0.0-compose-experimental-alpha-02")
api("com.arkivanov.essenty:lifecycle:1.1.0")
I have posted on the channel. Lets see if we get any response
a
But it's not the same, you have to use the experimental version for both
a
I replaced experimental for both decompose and jetbrain extension, but still the same. Also only following are accessible:
a
It feels that only things actually used in Kotlin are exported, isn't it?
j
Is iosApp build successfull via xcode/androidStudio? If not, make it build by uncomment all broken stuff and try to build until its successful. Maybe the iOS framework is still the old one …
a
It feels that only things actually used in Kotlin are exported, isn't it?
I would say yes majority are those classes.
StackNavigation
is not accessible although I have used it in root component.
Is iosApp build successfull via xcode/androidStudio? If not, make it build by uncomment all broken stuff and try to build until its successful. Maybe the iOS framework is still the old one … (edited)
I am aware of this fact. I have commented out my all code and trying with limited lines only. Without
DefaultComponentContext
, it compiles fine. Did you try at your end with same versions?
a
Would it be possible to share a reproducer?
a
Sure, I can prepare a sample project. Will let you know
a
Maybe, as an experiment, try also exporting the following? essenty-lifecycle = { group = "com.arkivanov.essenty", name = "lifecycle", version.ref = "essenty" } essenty-stateKeeper = { group = "com.arkivanov.essenty", name = "state-keeper", version.ref = "essenty" } essenty-instanceKeeper = { group = "com.arkivanov.essenty", name = "instance-keeper", version.ref = "essenty" } essenty-backHandler = { group = "com.arkivanov.essenty", name = "back-handler", version.ref = "essenty" }
a
It's working 😄 😄 🎉🎉 I can see the classes accessible in the xcode now. Thank you @Arkadii Ivanov for your time and help! ❤️
a
This still looks like a bug, perhaps in Cocoapods plugin!
I will ask someone from JB.
Could you please also share what Essenty version you are using?
a
I see. I am using 1.1.0 Essenty version. Do you still need the demo to reproduce the issue?
a
No need for now, thanks!
140 Views