multiplatform-swiftpackage icon indicating copy to clipboard operation
multiplatform-swiftpackage copied to clipboard

Create XCFramework for arm simulator

Open jizoquval opened this issue 4 years ago • 10 comments

Hi guys, your plugin is awesome! But I stuck with one problem. Here is my configuration :

multiplatformSwiftPackage {
    packageName("XXX")
    swiftToolsVersion("5.3")
    targetPlatforms {
        iOS { v("13") }
    }
}

createSwiftPackage task generates Swift package with two targets ios-arm64 and ios-x86_64-simulator, this works great on Intel Mac simulators and iPhones, but this not works on Apple silicone arm simulator.

So is it possible to generate target for Arm simulator ?

jizoquval avatar Apr 01 '21 05:04 jizoquval

Having the same issue, but it's not related to this plugin. Apple Silicon support is on the Kotlin Roadmap. For details, see these tickets: KT-43667 and KT-45302

batuypn avatar Jul 09 '21 08:07 batuypn

Seems like Kotlin supports Apple Silicon beginning with version 1.5.30: https://blog.jetbrains.com/kotlin/2021/07/kotlin-1-5-30-m1-released/

Can anyone confirm if it works? 😃

bogdan-razvan avatar Aug 30 '21 14:08 bogdan-razvan

@bogdan-razvan Not works. As I understand kotlin team added a new targets macosArm64, iosSimulatorArm64, watchosSimulatorArm64, tvosSimulatorArm64 so need to add it into the plugin. @ge-org Do you have any near plans for support it? Or you will wait pull requests from community?

jizoquval avatar Aug 31 '21 03:08 jizoquval

Anyway I submitted new pull request with new targets support.

jizoquval avatar Sep 02 '21 13:09 jizoquval

Is this planned to be merged ? I need to run on arm simulator.

tibo9 avatar Sep 22 '21 08:09 tibo9

I'm looking for the same. Any chance PR to be merged in order to support M1 chip? @ge-org, thank you!

Devepre avatar Sep 30 '21 09:09 Devepre

Heyo, also waiting on this merge, thanks @jizoquval!

mqln avatar Oct 06 '21 13:10 mqln

I'm also very interested in this. Do you think it will happen or is it time to look for alternatives?

jsamse avatar Oct 12 '21 19:10 jsamse

Hey guys, did anyone find a solution for this without this plugin?

ln-12 avatar Apr 14 '22 14:04 ln-12

There is a workaround for me. In build.gradle.kts plugins { ... id("org.jetbrains.kotlin.native.cocoapods") version "1.7.10" ... } ... kotlin { // HERE IS THE KEY PART. You can add whatever platform you want to package in the xcframework. iosX64() iosArm64() iosSimulatorArm64() ... cocoapods { summary = "..." homepage = "https://gitlab.com/...." version = "x.x.x" ios.deploymentTarget = "15" framework { baseName = "awesome name" } } ... }

Yeah just that cocoapods plugin. If you already know how to use it. That's awesome.

Once the plugin is set up right. Run gradle command in cocoapods/podPublishDebugXCFramework. You can also choose the release one.

You'll get the framework at project_folder/build/cocoapods/publish/debug/awesome_name.xcframework

Replace awesome_name.xcframework in the folder where multiplatform-swift-package created.

Make sure the names created by both are the same. Otherwise just change the name in Package.swift will also be ok.

manuqiao avatar Dec 22 '22 08:12 manuqiao