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

Md Hanif

01/24/2021, 10:12 AM
a

Artyom Degtyarev [JB]

01/25/2021, 7:48 AM
Hello, @Md Hanif! As far as I can see, the problem is caused by the
packForXcode
task deriving which build mode should be used from the schema name. Hardcoding it to be always
DEBUG
should prove that this is the cause. Then, you’ll be able to change the rule being used to set the mode(e.g. checking
System.getenv("CONFIGURATION") == DEVELOPMENT
and setting an appropriate mode).
m

Md Hanif

01/25/2021, 7:56 AM
nope I have already tried what you just said but it doesn't help.
a

Artyom Degtyarev [JB]

01/25/2021, 11:25 AM
What do you mean by “doesn’t help” here? I tried to create a
DEBUG
’s duplicate with a fancy name(using Xcode), and it failed as expected. Setting
mode = "DEBUG"
made this error gone. Maybe you faced another error after that?
m

Md Hanif

01/25/2021, 11:37 AM
no I tried this same as you suggested
Copy code
System.getenv("CONFIGURATION") ?: "DEVELOPMENT"
here I had
DEVELOPMENT
instead of default
DEBUG
and I got the same error as mentioned in the question.
a

Artyom Degtyarev [JB]

01/25/2021, 11:48 AM
This is not what I suggested, sorry for confusing you. My idea was 1. To check if the problem is just the
mode
variable containing inappropriate symbols. To figure it out, I recommended you to try setting it as
Copy code
val packForXcode by tasks.creating(Sync::class) {
    group = "build"
    //val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
    val mode = "DEBUG"
    val sdkName = System.getenv("SDK_NAME") ?: "iphonesimulator"
...
I already checked it locally, and it works as expected. Therefore, my second recommendation was: 2. Try changing the original line to be set on
RELEASE
when you build for the release, and to
DEBUG
when you build your development, debug, etc. To achieve that, I would recommend something like
Copy code
val mode = if (System.getenv("CONFIGURATION").toUpperCase() == "DEBELOPMENT") "DEBUG" else System.getenv("CONFIGURATION")
...
m

Md Hanif

01/25/2021, 3:32 PM
okay thanks for the help i'll try this asap.
2 Views