# How to build Arm64&X86\_64 in the same time?（Kotlin Framework architecture problem IOS）

**URL:** <https://discuss.kotlinlang.org/t/how-to-build-arm64-x86-64-in-the-same-time-kotlin-framework-architecture-problem-ios/13491>\
**Category:** Native\
**Created:** [July 15, 2019, 12:40pm UTC](https://discuss.kotlinlang.org/t/how-to-build-arm64-x86-64-in-the-same-time-kotlin-framework-architecture-problem-ios/13491 "2019-07-15T12:40:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hxxyyangyong](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/hxxyyangyong/32/6571_2.png) [@hxxyyangyong](https://discuss.kotlinlang.org/u/hxxyyangyong)\
**Post date:** [July 15, 2019, 12:40pm UTC](https://discuss.kotlinlang.org/t/how-to-build-arm64-x86-64-in-the-same-time-kotlin-framework-architecture-problem-ios/13491/1 "2019-07-15T12:40:13Z")

</div>

now is support Arm64 or x86\_64, not And

---

<div class="post-metadata">

**Author:** ![rshigenari](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rshigenari](https://discuss.kotlinlang.org/u/rshigenari)\
**Post date:** [July 31, 2019, 4:55pm UTC](https://discuss.kotlinlang.org/t/how-to-build-arm64-x86-64-in-the-same-time-kotlin-framework-architecture-problem-ios/13491/2 "2019-07-31T16:55:37Z")

</div>

Is possible generate 2 frameworks in different folders but using the same build.gradle file?

---

<div class="post-metadata">

**Author:** ![hxxyyangyong](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/hxxyyangyong/32/6571_2.png) [@hxxyyangyong](https://discuss.kotlinlang.org/u/hxxyyangyong)\
**Post date:** [August 1, 2019, 3:37am UTC](https://discuss.kotlinlang.org/t/how-to-build-arm64-x86-64-in-the-same-time-kotlin-framework-architecture-problem-ios/13491/3 "2019-08-01T03:37:10Z")

</div>

I did, but I still need to change the configuration to execute the build twice.  
Arm64 setBuilddir(“arm64build”) Build  
X64 Build  
lipo this framework,this ok, **But too cumbersome**  
Did not find a build out at the same time two framework methods

---

<div class="post-metadata">

**Author:** ![saschpe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/saschpe/32/6753_2.png) [@saschpe](https://discuss.kotlinlang.org/u/saschpe)\
**Post date:** [September 12, 2019, 11:35am UTC](https://discuss.kotlinlang.org/t/how-to-build-arm64-x86-64-in-the-same-time-kotlin-framework-architecture-problem-ios/13491/4 "2019-09-12T11:35:53Z")

</div>

Have a look at the **FatFrameworkTask** , assuming you build a framework _Foo_, it can be utilized like this (Gradle Kotlin DSL using configuration avoidance API):

```
kotlin {
    iosArm64 { binaries.framework("Foo") }
    iosX64 { binaries.framework("Foo") }

    sourceSets { … }

    tasks {
        register("universalFrameworkDebug", FatFrameworkTask::class) {
            baseName = "Foo"
            from(
                iosArm64().binaries.getFramework("Foo", "Debug"),
                iosX64().binaries.getFramework("Foo", "Debug")
            )
            destinationDir = buildDir.resolve("bin/universal/debug")
            group = "Universal framework"
            description = "Builds a universal (fat) debug framework"
            dependsOn("linkFooDebugFrameworkIosArm64")
            dependsOn("linkFooDebugFrameworkIosX64")
        }
    }
}

```

The task for the release build would look similar…
