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

Darmaheev

07/07/2019, 2:59 AM
Hello everyone, can anyone help me? When I try to add a transitive dependency to Ios target, I get the error
Copy code
"Could not find method export () for arguments [<myLibrari>] on object of type org.jetbrains.kotlin.gradle.dsl.KotlinNativeBinaryContainer"
This library in the sourceSet is declared as api. Gradle version 4.10.3. kotlin-multiplatform 1.3.41. My build.gradle -
Copy code
kotlin {
    targets {
        final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
                              ? presets.iosArm64 : presets.iosX64

        fromPreset(iOSTarget, 'ios') {
            binaries {
                export "myLybrary"
                framework('framework-ios')
            }
        }
    }
    sourceSets {
        commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
                implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serializer_version"
            }
        }
        iosMain {
            dependencies {
                implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serializer_version"
                api "myLybrary"
            }

        }
    }
}
b

basher

07/07/2019, 3:31 AM
I believe export goes inside the framework, not directly under binaries
l

louiscad

07/07/2019, 7:37 AM
Did you try using Gradle 5.4.1 or newer?
d

Darmaheev

07/07/2019, 10:51 AM
Thanks, I was inattentive.