https://kotlinlang.org logo
#ios
Title
# ios
e

einar

09/26/2019, 5:36 PM
Has anyone had success with custom build configurations in xcode (those apart from debug and release) together with a MPP shared library? I have created a configuration called PreProd that targets a different server url. When trying to build that configuration in iOS I get
No enum constant org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.PREPROD
. (Im using cocoapods)
b

basher

09/26/2019, 6:29 PM
You want build config from Xcode exposed to Kotlin?
e

einar

09/26/2019, 7:59 PM
Well really I'd be fine with an option that let me use the release version of my Kotlin lib for the preProd config of the iOS app. So Kotlin would not need to know about the config.
b

basher

09/26/2019, 10:06 PM
Hm okay. I think I'm still confused about what you're trying to do
e

einar

09/27/2019, 3:34 AM
Oh, sorry. In addition to the debug and release configurations in iOS I'd like a preProd configuration. When I create that in xcode and build I get the above error. I get the feeling that xcode is expecting a configuration of my mpp library with the same name.
b

basher

09/27/2019, 4:14 AM
Do you have an example of where you're trying to use that constant (gradle code)?
e

einar

09/27/2019, 5:15 AM
I’m not sure what you mean. Which constant?
Oh the Enum constant in the error? I’m not referencing it anywhere. I get a feeling that xcode is expecting for it to exist somewhere
Solved it with some help in #multiplatform. The trick was to edit the configuration in the common.podspec file so that if the configuration from iOS was PreProd I should build the release version of common.
Copy code
`-Pkotlin.native.cocoapods.configuration=$(if [ $CONFIGURATION = "PreProd" ]; then echo "Release"; else echo $CONFIGURATION; fi)  \`
👍 2
4 Views