![]() ![]() ![]() I have changed the question because, initially, I thought that cinterop was not creating the klib library but it was just a mistake: I was looking in the ping-build folder but the file is outside that folder. Text = "#!/bin/bash\nexport 'JAVA_HOME=$'\n./gradlew packForXCode ProguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'įinal def iOSTarget = System.getenv('SDK_NAME')?.startsWith('iphoneos') ? presets.iosArm64 : presets.iosX64Īpi ':kotlin-stdlib-common'įinal File frameworkDir = new File(buildDir, "xcode-frameworks")įinal String mode = project.findProperty("XCODE_CONFIGURATION")?.toUpperCase() ?: 'DEBUG'įinal def framework = .getFramework("shared", mode) I did it for the iOS project but I still don't know how to access the kotlin classes neither on Android nor on iOS. Here they say that I can use something like: implementation files("ping.klib") I have found different ways to import it but I did not find any complete description of how to do it. How can I use the library created by cinterop in my kotlin-multiplatform project? When I run the command cinterop -def f -o ping, it creates the klib file and a folder containing a manifest.properties file a natives subfolder containing a cstubs.bc file and a kotlin subfolder with a. It is created in the folder /Users/username/myproject/ping/cmake-build-debug Libping.a is the library created building the C code. LibraryPaths = /opt/local/lib /Users/username/myproject/ping/cmake-build-debug LinkerOpts.linux = -L/usr/lib/x86_64-linux-gnuĬompilerOpts = -std=c99 -I/Users/username/myproject/ping/ping/header def file that I use to build the library using cinterop. Void* ping(const char * url, const PingCallback *pingCallback) Two singles were released ahead of the album: the title track, 'Ummon', in 2019, and 'Hyperion' in 2020. The album was released on 28 February 2020 through Vicious Circle. Typedef void (*PingCallback)(PingInfo pingInfo) Ummon is the second studio album by French progressive rock band, Slift. I have also created a library in C that exposes a C interface. I have also used XCode to build an iOS app that uses the multiplatform lib on iOS.Įverything works fine and I'm able to use the expect fun that is implemented by different actual fun for Android and iOS. I have created an Android app module that uses the multiplatform lib on Android. For the first time, I'm using Android Studio to build a multiplatform project. ![]()
0 Comments
Leave a Reply. |