![]() ![]() You can implement all clients natively: Android in Kotlin and iOS on Swift. Well, you can and you don’t need to write anything in JavaScript. Just to push it a bit more, imagine that you can even share parts with a backend, for instance, API definitions, utils or DTO objects. ![]() Now imagine that you can reuse this code on Web. Imagine that you don’t need to implement the same features for Android and iOS separately. Val frameworkDestinationDir = buildDir.Multiplatform native development in Kotlin Configure your Kotlin Multiplatform lib to generate iOS binaries Set a name for your framework in a single place and reuse the variable output combined.xcframework Custom Gradle Task to Build “Fat” framework import .tasks.FatFrameworkTask This solutions ends up combining the two frameworks into a single XCFramework. This Stack Overflow post shows you how to create an XCFramework from your two frameworks, and I’ll follow up with a blog post on how to do it with an XCFramework a bit later. I ended up with this Error Message in XCode 12.4: “Building for iOS Simulator, but the linked and embedded framework ‘my_amework’ was built for iOS + iOS Simulator.” This “Fat” framework method no longer works with XCode 12+. This is not a full file, but just the additional parts needed for a Kotlin Multiplatform project to build a “Fat” framework. This article contains the configuration I used to build the “Fat” framework. If you are going use your Kotlin Multiplatform library as a framework in an existing app, you will want to provide a “Fat” framework which will contain both Arm64 and X64 architectures. Frameworks are typically compiled for a specific target architecture which can then be run on an iPhone, iPad or iOS Simulator on your Intel Macbook. If you are building a Kotlin Multiplatform library which will be consumed by an existing iOS application, using a framework is a great way to do this. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |