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

nrobi

01/21/2020, 10:16 AM
I’m using
cocoapods
to add the dependency for my
common
. However I’m getting
Could not build Objective-C module 'common'
without any more information. Is there any way to find more information why is the build failing?
a

Artyom Degtyarev [JB]

01/21/2020, 10:28 AM
Can you share the build.gradle(.kts)? Also, maybe looking through this doc(https://github.com/JetBrains/kotlin-native/blob/master/COCOAPODS.md) can help a bit.
n

nrobi

01/21/2020, 11:02 AM
s

Sean Keane

01/21/2020, 11:22 AM
Are you using generics? you might need to add this.
Copy code
iOSTarget("ios") {
    compilations {
        val main by getting {
            kotlinOptions.freeCompilerArgs = listOf("-Xobjc-generics")
        }
    }
}
n

nrobi

01/21/2020, 11:39 AM
Yess. I’ve already added that
a

Artyom Degtyarev [JB]

01/21/2020, 11:54 AM
So, you’re able to install the pod correctly, but it fails when the Xcode build is run? Please check the Podfile in your project directory.
n

nrobi

01/21/2020, 11:59 AM
Yes. exactly, it sees the
common
when I’m trying to import but fails at the build
a

Artyom Degtyarev [JB]

01/21/2020, 12:11 PM
You can have additional output by adding Gradle’s
--info
flag to the appropriate building phase in Xcode.
n

nrobi

01/21/2020, 12:49 PM
Yes now I’m having the following error
could not find kodein-di-erased.klib
a

Artyom Degtyarev [JB]

01/21/2020, 1:08 PM
n

nrobi

01/21/2020, 1:26 PM
Yes. Exactly. But I've checked and I'm using kotlin-native-macos-1.3.60
Managed to fix it by upgrading kodein to
6.5.1
🎉 2
s

Sean Keane

01/22/2020, 4:50 PM
Did you update Ktor or a different lib? Ktor is currently on 1.3.0
n

nrobi

01/23/2020, 6:26 AM
Sorry. I ment
kodein
4 Views