Hi All, I am having a problem when compiling my p...
# kotlin-native
e
Hi All, I am having a problem when compiling my project. This is the error:
Task BcLibcinteropRUAIos
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler. Downloading dependency: https://download.jetbrains.com/kotlin/native/libffi-3.2.1-3-darwin-macos.tar.gz (72.6 kiB/72.6 kiB). Done. Extracting dependency: /Users/vnteumr/.konan/cache/libffi-3.2.1-3-darwin-macos.tar.gz into /Users/vnteumr/.konan/dependencies Downloading dependency: https://download.jetbrains.com/kotlin/native/clang-llvm-apple-8.0.0-darwin-macos.tar.gz (393.8 MiB/393.8 MiB). Done. Extracting dependency: /Users/vnteumr/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz into /Users/vnteumr/.konan/dependencies e: /Users/vnteumr/workspace/bc-android/bc-kmp/BcLib/build/classes/kotlin/ios/main/BcLib-cinterop-RUA.klib-build/kotlin/com/ingenico/lar/bc/bc.kt: (31, 23): Unresolved reference: UIAxis e: /Users/vnteumr/workspace/bc-android/bc-kmp/BcLib/build/classes/kotlin/ios/main/BcLib-cinterop-RUA.klib-build/kotlin/com/ingenico/lar/bc/bc.kt: (1345, 78): Unresolved reference: UIAxis e: /Users/vnteumr/workspace/bc-android/bc-kmp/BcLib/build/classes/kotlin/ios/main/BcLib-cinterop-RUA.klib-build/kotlin/com/ingenico/lar/bc/bc.kt: (1437, 70): Unresolved reference: UIAxis It is very strange because the error happened when I was trying to generate a FatFramerkork. After the compile error, I rollback the changes I have done on gradle.build file . However, the error still happen after rollback. Then, I deleted all cache files (.gradle, .idea, .konan) and tried to build again. The same error happens. Have you faced this error? Do you know how to fix it?
I have found that UIAxis is a new struct available from 13.4+. I have just updated MacOS in my computer. Could it be related to this issue? How can I set Kotlin to compile for older iOS versions?
a
Hello, @Euler! First of all, I would sincerely ask you to avoid cross-posting. Then, can you share what framework you were trying to interoperate with?
e
Hi Artyom, sorry about that. I was unsure about the correct channel to post. The framework is an internal library. I am not allowed to share. Do you know about the process of generating the .kt file from a framework? Is there a way to control the iOS compatibility version for the code generated? I am using cinterop to add the framework my project depends on. I have seen in the kotlinlang.org that it is possible to use cocoapods instead. However, I did not understand how to do it. Do you have any clue about it? The point is that the framework is locally and not available in a remote pod.
I have found the root cause of this issue. The Kotlin-native for iOS is not working with Xcode-11.4. I had to downgrade to Xcode-11.3.1. Now, I can build my project again.
a
Hello again! Finally, we found a root cause of this problem, and prepared a workaround for you and other devs who want to use Xcode 11.4 with K/N 1.3.7*. There is an empty kotlin library with some special manifest details, adding it to your dependencies should make compilation working fine. This is an example of it’s use:
Copy code
repositories {
    maven {
        setUrl("<https://kotlin.bintray.com/native-xcode>")
    }
}

kotlin.sourceSets["commonMain"].dependencies {
    implementation("org.jetbrains.kotlin.native.xcode:kotlin-native-xcode-11-4-workaround:1.3.72.0")
}