Hi, i have a problem building an iOS lib with kotlin native and bitcode enabled
With command line i use this command:
kotlinc-native src/path -produce framework -target ios_arm64 -Xembed-bitcode -output iOS/LibName
but i need to use serialization lib and i switch to gradle build
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$kotlinVersion"
}
}
apply plugin: 'org.jetbrains.kotlin.platform.native'
apply plugin: 'kotlinx-serialization-native'
repositories {
mavenLocal()
jcenter()
maven { url "http://kotlin.bintray.com/kotlinx" }
maven { url "http://kotlin.bintray.com/kotlin-eap" }
}
components.main {
outputKinds = [FRAMEWORK]
targets = ['ios_arm64']
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serializationRuntimeVersion"
}
}
But i can’t compile iOS app with XCode and i have this error
ld: '/Users/path/LibName.framework/LibName' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/path/LibName.framework/LibName' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I found this on github repo: https://github.com/JetBrains/kotlin-native/blob/master/FAQ.md#q-how-do-i-enable-bitcode-for-my-kotlin-framework but I can not implement it in my gradle script
Any ideas?
Thanks
Raphaël