https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Slackbot

07/25/2021, 6:18 AM
This message was deleted.
n

Nikola Milovic

07/25/2021, 6:19 AM
Setup
Copy code
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
    kotlin("multiplatform")
    kotlin("native.cocoapods")
    id("android-setup")
}


// CocoaPods requires the podspec to have a version.
version = "1.0"


kotlin {

    android()
    ios()

    sourceSets {
        named("commonMain") {
            dependencies {
                implementation(project(":common:utils"))
            }
        }
    }

    cocoapods {

        ios.deploymentTarget = "13.5"
        summary = ""
        homepage = ""
        frameworkName = "AmplifyKMP"

        pod("Amplify")
    }

    // Configure the framework which is generated internally by cocoapods plugin
    targets.withType<KotlinNativeTarget> {
        binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework> {
            isStatic = true
            transitiveExport = true
        }
    }
}
v

Viacheslav Kormushkin

07/25/2021, 7:28 AM
Hi, are you sure this actually fails the build? It looks more like a warning. Anyway, check that you target platform specified in your podfile. platform :ios, '8.0'
n

Nikola Milovic

07/25/2021, 10:13 AM
@Viacheslav Kormushkin Yeah it seems that something else was the case, after playing around with settings I got it to compile. But thanks for pointing it out, it was just a warning...🤦‍♂️
3 Views