Hi, guys. I’m trying to use cocoapod library on mu...
# kotlin-native
h
Hi, guys. I’m trying to use cocoapod library on multiplatform library There are - ios library on Xcode - multiplatform library : depends on ios library - multiplatform module : depends on multiplatform library - ios project on Xcode : depends on multiplatform module by cocoapod it’s success to build the multiplatform library with cocoapod library but when I build ios project on Xcode, build failed. is it available to use cocoapod on multiplatform library?
Xcode error log kotlinIOS : ios project name ios_library : ios library name foo : ios library’s function name
multiplatform library’s build.gradle
Copy code
cocoapods {
        summary = "d"
        homepage = "d"

        pod("ios_library", "0.0.1", project.file("../ios_library/ios_library.podspec"))
    }
multiplatform module’s build.gradle
Copy code
cocoapods {
        summary = "Sample"
        homepage = "sample"

        podfile = project.file("../kotlinIOS/Podfile")
    }
i
I think the clue is in
not found for architecture x86_64
What does your targets DSL block look like?
Copy code
targets {
        val sdkName: String? = System.getenv("SDK_NAME")

        val iOSDevice = sdkName.orEmpty().startsWith("iphoneos")
        if (iOSDevice) {
            iosArm64("iOS64")
        } else {
            iosX64("iOS")
        }

        macosX64("macOS")
        android()
    }
h
@Ian Arbuckle Thanks for replying. I used target below as it adds
iosX64
and
iosArm64
both.
Copy code
ios()
i
I see! nice to know it is simplified now. I looked at the kampkit sample and they've commented in their build.gralde file that
ios()
is currently not working with gradle plugin. https://github.com/touchlab/KaMPKit/blob/master/shared/build.gradle.kts
h
@Ian Arbuckle I see. It’s working for me but some limitation in my feeling. I think
co.touchlab.native.cocoapods
provide extended functions which I need. Thanks for sharing good sample code.🙏🙏
👍 1