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

Brendan Weinstein

04/13/2020, 3:29 AM
Just sanity checking, but are most folks using
cinterop
to manually wire objc/swift dependencies into iosMain or have folks managed to get the cocoapods plugin to smoothly do this by declaring a pod?
k

Kurt Renzo Acosta

04/13/2020, 3:54 AM
I'm using pods and it simply is just declaring a pod. I use it for
AWSS3
and some Firebase libraries. Some don't work though like
AWSCore
. There's an issue if you wanna look at it.
👍 1
b

Brendan Weinstein

04/13/2020, 4:06 AM
thanks! I'll give pods another troubleshooting session. Applying this raywenderlich tutorial I am able to get generated kotlin bindings to work in iosX64 (cinterop tasks are generated for x64, arm32, and arm64 but there is no generic iosMain cinterop task) Using the cocoapods plugin I can see four
interop
tasks for each pod I list in the
cocoapods
block (
Ios
,
Iosx64
,
IosArm32
,
IosArm64
), I install the pods with
pod install
, and when I try to run any of the interop tasks I get the error
cannot determine headers location
Based on this I should build from xcode first and then be able to import
cocoapods.AFNetworking
but I am still not seeing it show up without red in either iosMain or iosX64
k

Kurt Renzo Acosta

04/13/2020, 4:17 AM
How are you defining your iOS targets?
b

Brendan Weinstein

04/13/2020, 4:19 AM
Copy code
val iosArm32 = iosArm32("iosArm32")
  val iosArm64 = iosArm64("iosArm64")
  val iosX64 = iosX64("iosX64")

  if (ideaActive) {
    iosX64("ios")
  }

sourceSets {
val iosMain = if (ideaActive) {
      getByName("iosMain")
    } else {
      create("iosMain")
    }

    val iosArm32Main by getting
    val iosArm64Main by getting
    val iosX64Main by getting

    configure(listOf(iosArm32Main, iosArm64Main, iosX64Main)) {
      dependsOn(iosMain)
    }
}
oi! I had some build code for defining tasks to create debug and release fat frameworks left in (am in the process of updating my shared lib buildscript) and removing those tasks fixed the issue. thanks for asking the question -- it helped focus my debugging attention
👏 1