Hi All ...I am new to compose-ios I have observed ...
# compose-ios
a
Hi All ...I am new to compose-ios I have observed this weird issue where I am not able to run ios app where the composable shared code is not accessible from iosMain. This issue is something related compose ios if I remove composable annotation and then try to call the fun from iosMain which is written in the shared folder it runs fine. App.kt
Copy code
@Composable
fun App(){
    Text("Hello")
}
this is the shared gradle file
Copy code
plugins {
    kotlin("multiplatform")
    kotlin("native.cocoapods")
    id("com.android.library")
    id("org.jetbrains.compose")
}

kotlin {
    android {
        compilations.all {
            kotlinOptions {
                jvmTarget = "1.8"
            }
        }
    }
    iosX64()
    iosArm64()
    iosSimulatorArm64()

    cocoapods {
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        version = "1.0"
        ios.deploymentTarget = "14.1"
        podfile = project.file("../iosApp/Podfile")
        framework {
            baseName = "shared"
            isStatic=true
        }
    }
    
    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(compose.runtime)
                implementation(compose.foundation)
                implementation(compose.material)
                implementation(compose.ui)
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test"))
            }
        }
        val androidMain by getting {
            dependencies {
                // Android
                api(libs.androidx.activity.compose)
                api(libs.androidx.appcompat)
                api(libs.androidx.core.ktx)

                // Ktor
                api(libs.ktor.client.okhttp)
            }
        }
        val androidUnitTest by getting
        val iosX64Main by getting
        val iosArm64Main by getting
        val iosSimulatorArm64Main by getting
        val iosMain by creating {
            dependsOn(commonMain)
            iosX64Main.dependsOn(this)
            iosArm64Main.dependsOn(this)
            iosSimulatorArm64Main.dependsOn(this)

        }
        val iosX64Test by getting
        val iosArm64Test by getting
        val iosSimulatorArm64Test by getting
        val iosTest by creating {
            dependsOn(commonTest)
            iosX64Test.dependsOn(this)
            iosArm64Test.dependsOn(this)
            iosSimulatorArm64Test.dependsOn(this)
        }
    }
}

android {
    namespace = "com.retroent.moviebuff"
    compileSdk = 33
    defaultConfig {
        minSdk = 24
    }
}
🧵 3
a
Can you please stop sending enormous equal code fragments to the general chat? It makes difficult to read other messages...
d
You can take a look at our template here: https://github.com/JetBrains/compose-multiplatform-ios-android-template If it is not helpful, you can create a minimal reproducible example of this problem and share it on GitHub.
Also, for our Slack, it is better to write a short message without long code listing. And add code as a separate message to the thread of this message. It helps other users with reading chat history.