title: Kotlin Multiplatform Library: Unable to generate .framework for iOS
body: <p>I am new to Android/KotlinMultiplatform , I am trying to create a library for iOS/Android using Kotlin Multiplatform.</p>
  <p>When I run the command on terminal
  <code>./gradlew :shared:packForXcode</code>
  It succeeds but could not find a <code>/build/xcode-frameworks</code> folder inside the root folder.</p>
  <p>Could anyone help me to find where it is going wrong...?</p>
  <p>IntelliJ CE Version : 2020.2.3</p>
  <p>My Gradle file Content:</p>
  <pre><code>plugins {
      id(&quot;org.jetbrains.kotlin.multiplatform&quot;) version &quot;1.4.10&quot;
      id(&quot;com.android.library&quot;)
      id(&quot;kotlin-android-extensions&quot;)
      &quot;maven-publish&quot;
  }
  repositories {
      mavenCentral()
  }
  
  group &quot;me.myname&quot;
  version &quot;0.0.1&quot;
  
  kotlin {
      targets {
          android()
          ios {
              binaries {
                  framework {
                      baseName = &quot;MyLib&quot;
                  }
              }
          }
      }
  
      sourceSets {
          val commonMain by getting {
              dependencies {
                  implementation(&quot;org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9&quot;)
              }
          }
          val androidMain by getting {
              dependencies { }
          }
          val iosMain by getting {
              dependencies { }
          }
      }
  
  }
  
  android {
      compileSdkVersion(29)
      defaultConfig {
          minSdkVersion(24)
          targetSdkVersion(29)
          versionCode = 1
          versionName = &quot;1.0&quot;
      }
      buildTypes {
          getByName(&quot;release&quot;) {
              isMinifyEnabled = false
          }
      }
  }
  
  val packForXcode by tasks.creating(Sync::class) {
      val targetDir = File(buildDir, &quot;xcode-frameworks&quot;)
  
      /// selecting the right configuration for the iOS
      /// framework depending on the environment
      /// variables set by Xcode build
      val mode = System.getenv(&quot;CONFIGURATION&quot;) ?: &quot;DEBUG&quot;
      val sdkName: String? = System.getenv(&quot;SDK_NAME&quot;)
      val isiOSDevice = sdkName.orEmpty().startsWith(&quot;iphoneos&quot;)
  
      val framework = kotlin.targets
          .getByName&lt;KotlinNativeTarget&gt;(
              if(isiOSDevice) {
                  &quot;iosArm64&quot;
              } else {
                  &quot;iosX64&quot;
              }
          )
          .binaries.getFramework(mode)
  
      inputs.property(&quot;mode&quot;, mode)
      dependsOn(framework.linkTask)
  
      from({ framework.outputDirectory })
      into(targetDir)
  
      println(&quot;Build Folder =&gt; $targetDir&quot;)
  
      /// generate a helpful ./gradlew wrapper with embedded Java path
      doLast {
          val gradlew = File(targetDir, &quot;gradlew&quot;)
          gradlew.writeText(&quot;#!/bin/bash\n&quot;
                  + &quot;export 'JAVA_HOME=${System.getProperty(&quot;java.home&quot;)}'\n&quot;
                  + &quot;cd '${rootProject.rootDir}'\n&quot;
                  + &quot;./gradlew \$@\n&quot;)
          gradlew.setExecutable(true)
      }
  }
  
  tasks.build.dependsOn(&quot;packForXCode&quot;)
  </code></pre>
  <p><strong>UPDATE</strong></p>
  <ol>
  <li>Project Created using IntelliJ IDEA, as below screenshot:</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/UrbYu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UrbYu.png" alt="enter image description here" /></a></p>
  <ol start="2">
  <li>My project structure looks like below:</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/KtmbO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KtmbO.png" alt="enter image description here" /></a></p>