https://kotlinlang.org logo
n

Nikolai

03/17/2019, 3:22 AM
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 :
Copy code
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:
Copy code
* 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.
Copy code
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

03/17/2019, 9:47 PM
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

03/18/2019, 1:10 AM
Thank, I will check this out
s

svyatoslav.scherbina

03/18/2019, 7:38 AM
n

Nikolai

03/19/2019, 12:26 AM
Thank you I will take a look on that issue.
10 Views