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

coletz

01/26/2019, 1:35 PM
ok just kidding, not working anymore on both projects... no idea why or what to do
r

russhwolf

01/26/2019, 1:52 PM
The APIs changed for native compilation artifacts, and I think some of the new project templates need updating. I found this thread helpful for understanding what needed to change: https://kotlinlang.slack.com/archives/C3PQML5NU/p1548403622428800
c

coletz

01/26/2019, 1:55 PM
wow, bad news then...
r

russhwolf

01/26/2019, 2:00 PM
Not so bad. This is all still experimental, and things change and evolve. You can’t expect everything to stay perfectly stable yet, but it’s generally moving in a good direction.
c

coletz

01/26/2019, 2:07 PM
"bad news" only because the template project generated by idea is not working anymore, while in the thread you shared Ilya said "But almost all the APIs introduced in 1.3.0 were saved in 1.3.20 to make build scripts compatible"...which seems fake?
maybe I've done something wrong
r

russhwolf

01/26/2019, 2:08 PM
I found doing something like this works:
Copy code
task copyFramework {
    def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
    def framework = kotlin.targets.ios.compilations.main.target.binaries.findFramework("Shared", buildType)
    dependsOn framework.linkTask

    doLast {
        def srcFile = framework.outputFile
        def targetDir = getProperty('configuration.build.dir')
        copy {
            from srcFile.parent
            into targetDir
            include 'Shared.framework/**'
            include 'Shared.framework.dSYM'
        }
    }
}
For a framework declared with
Copy code
def iosTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") ? presets.iosArm64 : presets.iosX64
    targetFromPreset(iosTarget, "ios") {
        binaries {
            framework("Shared")
        }
    }
c

coletz

01/26/2019, 2:32 PM
ok managed to get rid of this issue, but still the app framework is not recognized on the ios side... need to check some stuff
sorry for bothering you but I tried using your code or creating a new project... Every time I compile with xcode I get the issue "No such module 'app'"... Is it working for you?
r

russhwolf

01/26/2019, 3:30 PM
Is your framework named “app” in gradle?
c

coletz

01/26/2019, 9:33 PM
Afaik yes, the app framework is generated and I can see it in xcode, but it's not linked or something like that
So I'm totally stupid. Copied your code without checking it.
include 'Shared.framework'
<-- but my framework is
app
, not
Shared
...Everything is working now