Thread
#multiplatform
    n

    Nikolai

    3 years ago
    Hello, everyone I am working with multiplatform project. For a long time I worked on Android part. But today I started to work with iOS part, I added :
    dependencies {
                    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version"
                }
    to iosMain dependences because my project uses coroutines in common part. After that I changed graddlew to update graddle version. Then I run buildDependences task to build all dependences. Success, after that I tried to run XCode project but got error:
    * What went wrong:
    Could not determine the dependencies of task ':app:copyFramework'.
    > Task with path 'linkDebugFrameworkIos' not found in project ':app'.
    I went to IDEA and found that 'copyFramework' task depends on 'linkDebugFrameworkIos', but I didn't find it in graddle tasks list.
    task copyFramework {
        def buildType = project.findProperty("kotlin.build.type") ?: "DEBUG"
        def target = project.findProperty("kotlin.target") ?: "ios"
        dependsOn "link${buildType.toLowerCase().capitalize()}Framework${target.capitalize()}"
    
        doLast {
            def srcFile = kotlin.targets."$target".compilations.main.getBinary("FRAMEWORK", buildType)
            def targetDir = getProperty("configuration.build.dir")
            copy {
                from srcFile.parent
                into targetDir
                include 'app.framework/**'
                include 'app.framework.dSYM'
            }
        }
    }
    I assume that when I upgraded graddle and changed graddlew it somehow removed this task. How can I fix it?
    e

    Ellen Shapiro

    3 years ago
    I would take a look at the way which is suggested in the main MPP tutorial, which leaves the framework in the
    build/xcode-frameworks
    folder and sets xcode up to grab it during compilation rather than trying to move it around prior to that: https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#setting-up-framework-dependency-in-xcode
    I’ve been using this and it’s been very smooth.
    n

    Nikolai

    3 years ago
    Thank, I will check this out
    s

    svyatoslav.scherbina

    3 years ago
    n

    Nikolai

    3 years ago
    Thank you I will take a look on that issue.