ok just kidding, not working anymore on both proje...
# multiplatform
c
ok just kidding, not working anymore on both projects... no idea why or what to do
r
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
wow, bad news then...
r
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
"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
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
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
Is your framework named “app” in gradle?
c
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