question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrappers not generated with KSP when using embedAndSignAppleFrameworkForXcode

See original GitHub issue

This is an issue that got mixed with #49.

User @yamakentoc reports that this gradle config doesn’t result in wrapper classes being generated.

// HogeHogeHoge/shared/build.gradle.kts
// kotlin version: 1.7,0

val ktorVersion = "2.0.1"
val kotlinCoroutineVersion = "1.6.3"

plugins {
    kotlin("multiplatform")
    id("com.android.library")
    id("com.google.devtools.ksp") version "1.7.0-1.0.6"
    id("com.futuremind.koru").version("0.11.0")
    kotlin("plugin.serialization")
}

kotlin {
    android()

    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach {
        it.binaries.framework {
            baseName = "HogeHogeHoge"
        }
    }

    sourceSets {
        val commonMain by getting {
            dependencies {
                //Coroutines
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutineVersion-native-mt")
                //Network
                implementation("io.ktor:ktor-client-core:$ktorVersion")
                implementation("io.ktor:ktor-client-serialization:$ktorVersion")
                // JSON Serialization
                implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
                implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
                // client mock
                implementation("io.ktor:ktor-client-mock:$ktorVersion")
                // koru
                implementation("com.futuremind:koru:0.11.1")
                // firebase
                implementation("dev.gitlive:firebase-auth:1.6.1")
            }
        }

        val androidMain by getting {
            dependencies {
                //Network
                implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test-common"))
                implementation(kotlin("test-annotations-common"))
            }
        }

        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)
            dependencies {
                //Network
                implementation("io.ktor:ktor-client-darwin:$ktorVersion")
            }
        }
    }
}

android {
    compileSdk = 31
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    defaultConfig {
        minSdk = 27
        targetSdk = 31
    }
}

koru {
    nativeSourceSetNames = listOf("iosMain")
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
yamakentoccommented, Aug 11, 2022

gradlew runs when build with Xcode, so it may be affected スクリーンショット 2022-08-12 1 05 44

1reaction
micHarcommented, Aug 10, 2022

I assume that kapt working and ksp not for your setup has something to do with the gradle task that you use. In the example repo I build xcframework with gradle assembleXCFramework and it seems to pick up the ksp step. gradle shared:build or gradle shared:assemble should be fine, too.

The code looks fine to me. Not sure how operator fun will behave, but if kapt works, ksp will probably, too. Will add tests for that, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

KMM - Error Task 'embedAndSignAppleFrameworkForXcode ...
I built and ran it successfully on both devices: Android and iOS. After that, I re-ran the project on iOS. It had an...
Read more >
embedAndSignAppleFramework...
I think embedAndSignAppleFrameworkForXcode is not supposed to run from the terminal as packForXCode used be. The proper way to run this task is...
Read more >
Multiplatform Gradle Plugin Improved for Connecting KMM ...
It allows you to create a KMM project with a suitable iOS integration option – either the Cocoapods dependency manager or a regular...
Read more >
KSP resolves classes that are not available to the app #198
The KSP processor checks for the availability of the javax.annotation.processing.Generated class and adds that annotation if available.
Read more >
Hey all could somebody assist me with running my Multiplatfo
It seems to run using the simulator, but I keep getting this: ld: framework not found Pods_iosApp clang: error: linker command failed with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found