You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
The version of the kotlin gradle plugin I'm using is 1.4.10, and Android Studio 4.2 Canary 15. The project was started with the KMM template with the wizard.
The shared code module builds correctly, and in the external libraries hierarchy in android studio I can see the generated .klib libraries:
The content of the .knm files seems correct too:
But when I try to import this package in the a class of the iOSMain source set, the package is not resolved:
This is my def file:
language = Objective-C
modules = SlicerUtils
package = com.xxxxx.iosframeworks
And this is an extract of the build.gradle.kts file where the cinterop are defined:
val iosFrameworkBaseDir = "${projectDir}/../../ios-frameworks"
val slicerUtilsDir = file("$iosFrameworkBaseDir/SlicerUtils").absolutePath
val slicerUtilsBaseFrameworkDirX64 =
file("$slicerUtilsDir/DerivedData/SlicerUtils/Build/Products/Debug-iphonesimulator").absolutePath
val slicerUtilsBaseFrameworkDirArm64 =
file("$slicerUtilsDir/DerivedData/SlicerUtils/Build/Products/Debug-iphoneos").absolutePath
iosX64() {
compilations.getByName("main") {
val slicerUtils by cinterops.creating {
defFile("SwiftSlicerUtils.def")
compilerOpts(
"-framework",
"SlicerUtils",
"-F$slicerUtilsBaseFrameworkDirX64/"
) //As framework
}
}
binaries.all {
// Linker options required to link to the framework.
linkerOpts("-framework", "SlicerUtils", "-F${slicerUtilsBaseFrameworkDirX64}/")
}
}
iosArm64() {
compilations.getByName("main") {
val slicerUtils by cinterops.creating {
defFile("SwiftSlicerUtils.def")
compilerOpts(
"-framework",
"SlicerUtils",
"-F$slicerUtilsBaseFrameworkDirArm64/"
)//As framework
}
}
binaries.all {
// Linker options required to link to the framework.
linkerOpts("-framework", "SlicerUtils", "-F${slicerUtilsBaseFrameworkDirArm64}/")
}
}
I don't think it is a problem with the cinterop definition in the build.gradle.kts file, because the paths are correct and the shared code module builds without errors.
May somebody give me a clue?
The text was updated successfully, but these errors were encountered:
RoqueCampos
changed the title
package of cinterop dependency (Swift framework) not found in the iOSMain sources
package of cinterop dependency (Swift framework) not found in the iOSMain sources set
Nov 19, 2020
Probably a duplicate of KT-40975. Try switching the kotlin.native.enableDependencyPropagation value in your gradle.properties file.
In any case, please stop using GitHub issues of this repository for anything and prefer other ways of getting some help: #4079
I'm trying to import and use a self made Swift framework in a kotlin native shared code module, for the iOS sources set. I followed the guide to add a dependency to the iOS Sourceset: https://kotlinlang.org/docs/mobile/add-dependencies.html#without-cocoapods
The version of the kotlin gradle plugin I'm using is 1.4.10, and Android Studio 4.2 Canary 15. The project was started with the KMM template with the wizard.
The shared code module builds correctly, and in the external libraries hierarchy in android studio I can see the generated .klib libraries:
The content of the .knm files seems correct too:
But when I try to import this package in the a class of the iOSMain source set, the package is not resolved:
This is my def file:
And this is an extract of the build.gradle.kts file where the cinterop are defined:
I don't think it is a problem with the cinterop definition in the build.gradle.kts file, because the paths are correct and the shared code module builds without errors.
May somebody give me a clue?
The text was updated successfully, but these errors were encountered: