Hey guys, I added this to the common module depend...
# decompose
e
Hey guys, I added this to the common module dependencies and my gradle sync succeed:
Copy code
implementation("com.arkivanov.decompose:decompose:2.2.1")
            implementation("com.arkivanov.decompose:extensions-compose-jetbrains:2.2.1")
but for some reason AS doesn’t see
import com.arkivanov.decompose.extensions.compose.jetbrains.stack
package in the code in the common module. Other classes from `com.arkivanov.decompose`are visible. What could be the reason?
a
Do you support any targets apart from Android and Desktop?
e
I have also iOS target configured.
Copy code
listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach { iosTarget ->
        iosTarget.binaries.framework {
            baseName = "ComposeApp"
            isStatic = false
        }
    }
You need special version of Decompose. Or migrate to v3.x
e
What do you mean by special version. Am I missing something in the doc?
Ah, I see. This only works for Jvm
I will migrate to 3.0 then. Thank you. Is it stable enough?
a
image.png
You can either use
2.2.1-compose-experimental
, or
3.x
Breaking changes are still possible, though unlikely
e
Just curios, how does it work inside? I totally understand that iOS can not work if I use wrong dependency. But why when I edit code in the common module it doesn’t see the package inside the JVM dependency?
a
There is the
commonizer
thing in KMP, which also finds all usable APIs for all supported targets by a source set.
So
extensions-compose-jetbrains
only supports
android
and
jvm
, and so there are no usable APIs for
commonMain
if iOS is also supported.
e
Is it a gradle level check? So basically it will ignore any code which is not marked as compatible with all specified targets?
a
I think it's both IDE and compiler support
e
Thank you so much for the explanation! 🙂
❤️ 1
@Arkadii Ivanov after changing version to 3.0.0-alpha03 I am getting the following error on some methods in the common module:
Copy code
Cannot access class 'androidx.compose.ui.unit.Dp'. Check your module classpath for missing or conflicting dependencies

Cannot access class 'androidx.compose.ui.graphics.Shape'. Check your module classpath for missing or conflicting dependencies

Cannot access class 'androidx.compose.ui.graphics.Color'. Check your module classpath for missing or conflicting dependencies
Tried to clean the project and restart the AS but it doesn’t help.
Do you know why it could happen?
a
💡 1
e
Wow, great, that worked! Thanks! 🙂
K 1