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

Sylvain Patenaude

11/05/2019, 4:22 PM
Anyone has a web reference link to the API of tasks such as framework below? I'm not sure if I should keep framework() without parameters or if I should pass my project/module name as a parameter? kotlin { jvm() // This is for iPhone emulator // Switch here to iosArm64 (or iosArm32) to build library for iPhone device iosX64("ios") { binaries {
framework()
} } Edit: If I use
framework('MySDK')
, I get a gradle error
Key debugFramework is missing in the map.
.
a

Artyom Degtyarev [JB]

11/05/2019, 4:46 PM
I think the “Configuring binaries” section of this(https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#using-kotlinnative-targets) paragraph should help.
s

Sylvain Patenaude

11/05/2019, 7:26 PM
Yeah, in the example they give,
framework('my_framework' [RELEASE])
, they don't clearly specify the purpose of 'my_framework'. Is it just meant to be an output name or should it be a reference to a existing project/module?
a

Artyom Degtyarev [JB]

11/05/2019, 9:11 PM
Yes, the name has two purposes simultaneously- it specifies binary name for the script, and provides a prefix for the artifacts’ name. I think the problem here is that you’re trying to configure that binary somewhere below, and doing it by it’s name. As far as non-default name is specified in the parentheses, it throws an error. Please check the full script, or share it and let’s do it together.
s

Sylvain Patenaude

11/05/2019, 9:25 PM
Ok, here are my settings.gradle and build.gradle files (both in C:\Git\MySDK\ folder). I put back
framework()
(no parameters) and it builds fine. Of course on my computer (Windows) the iOS tasks are skipped, but when I build it through a DevOps build pipeline (with a macOS-10.14 image/agent), it still builds fine but with this output that I cannot figure put why it's happening:
Project MySDK at : is either no Android app project or build version has not been set to override. Skipping...
So no one ever encountered that issue? It looks to me like my project/main module 'MySDK' is detected/treated as a jvm target instead of a native ios target when built on a macOS agent. Then it would make sense to skip this project (on macOS). But the project is multiplatform with a native iOS target, so it shouldn't be skipped, right?
a

Artyom Degtyarev [JB]

11/08/2019, 11:49 AM
Can you please clarify some moments? I’m not sure that I understand everything correctly. 1) What is your project structure? The
settings.gradle
seems non-trivial, IMO. 2)What exactly do you mean under this “target detection”? When the
build
task is executed for the MPP module, it should process build for every available target, so it has to build the
iOS
one(ofc when Xcode version is ok and so on). Do you have a problem with actual framework production or this is more about a strange message?
7 Views