title: Unresolved reference: Platform, in multiplatform project
body: <p>I have created a kotlin shared library project (using Android Studio on Windows), the android side of things work fine, but for some reason when writing iOS specific code in Kotlin, I can't seem to import the <code>platform</code> libraries. I was following the instructions from <a href="https://mobiraft.com/android/kotlin/getting-started-with-kotlin-multiplatform/" rel="noreferrer">here</a> to get started.</p>
  <p>I did put <code>include ':Shared'</code> in my <code>settings.gradle</code> and also this    <code>implementation project(':Shared')</code> in my app <code>build.gradle</code></p>
  <p>My end goal is to have the library just have business logic that will be shared between iOS and Android. I'm just trying to get an example project running, so that I know it works.</p>
  <p>This is how my file structure is:</p>
  <p><a href="https://i.stack.imgur.com/uBwPm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uBwPm.png" alt="File structure" /></a></p>
  <p>My <code>build.gradle</code> for the <code>Shared</code> module:</p>
  <pre><code>apply plugin: 'java-library'
  apply plugin: 'kotlin-multiplatform'
  
  /*We are doing three things in the codebase below:
  
     1.  Listing out the target for the shared code. For Android, JVM target.
         For iOS, target depends on the device type, i.e. simulator or a real device.
  
     2.  We have defined iOS, Android and common source sets, which will allow different
         configuration for each source set.
  
     3.  We have created a task for Xcode to generate framework and add it to our iOS project.
     */
  kotlin{
      targets{
          //        //Xcode sets SDK_NAME environment variable - based on whether the
          //        //target device is a simulator or a real device, the preset should vary
          final def iOSTarget = System.getenv('SDK_NAME')?.startsWith(&quot;iphoneos&quot;) \
                                 ? presets.iosArm64 : presets.iosX64
  
  
          //outputKinds - FRAMEWORK would mean that the shared code would be exported as a FRAMEWORK
          // EXECUTABLE - produces a standalone executable that can be used to run as an app
          fromPreset(iOSTarget, 'ios'){
              binaries{
                  framework('Shared')
              }
          }
  
          //create a target for Android from presets.jvm
          fromPreset(presets.jvm, 'android')
      }
  
      //we have 3 different sourceSets for common, android and iOS.
      //each sourceSet can have their own set of dependencies and configurations
      sourceSets{
          commonMain.dependencies{
              api 'org.jetbrains.kotlin:kotlin-stdlib-common'
          }
          androidMain.dependencies{
              api 'org.jetbrains.kotlin:kotlin-stdlib'
              implementation fileTree(dir: 'libs', include: ['*.jar'])
              implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
          }
  
          iosMain{
  
          }
      }
  }
  configurations{
      compileClasspath
  }
  
  
  // This task attaches native framework built from ios module to Xcode project
  // Don't run this task directly,
  // Xcode runs this task itself during its build process when we configure it.
  // make sure all Gradle infrastructure exists (gradle.wrapper, gradlew)
  //and gradlew is in executable mode (chmod +x gradlew)
  task packForXCode(type: Sync) {
      final File frameworkDir = new File(buildDir, &quot;xcode-frameworks&quot;)
      final String mode = project.findProperty(&quot;XCODE_CONFIGURATION&quot;)?.toUpperCase() ?: 'DEBUG'
      final def framework = kotlin.targets.ios.binaries.getFramework(&quot;Shared&quot;, mode)
      inputs.property &quot;mode&quot;, mode
      dependsOn framework.linkTask
      from { framework.outputFile.parentFile }
      into frameworkDir
      doLast {
          new File(frameworkDir, 'gradlew').with {
              text = &quot;#!/bin/bash\nexport 'JAVA_HOME=${System.getProperty(&quot;java.home&quot;)}'\ncd '${rootProject.rootDir}'\n./gradlew \$@\n&quot;
              setExecutable(true)
          }
      }
  }
  
  tasks.build.dependsOn packForXCode
  
  sourceCompatibility = &quot;1.7&quot;
  targetCompatibility = &quot;1.7&quot;
  </code></pre>
  <p><code>commonMain</code> code:</p>
  <pre><code>//This function will be the general function declaration that will be used as
  //actual in our platform specific code.
  expect fun getCurrentDate() : String
  
  //This is the common function that will be called by Android and iOS app
  fun getDate():String{
      return &quot;Current Date is ${getCurrentDate()}&quot;
  }
  </code></pre>
  <p><code>androidMain</code> code:</p>
  <pre><code>import java.util.*
  
  actual fun getCurrentDate(): String{
      return Date().toString()
  }
  </code></pre>
  <p><code>iosMain</code> code (this is where the issue is):</p>
  <pre><code>//can't get this import to work.
  //import platform.Foundation.NSDate
  
  actual fun getCurrentDate(): String{
     //return NSDate().toString()
      return &quot;&quot;
  }
  </code></pre>
  <p>My android <code>MainActivity</code> (this works) :</p>
  <pre><code>import androidx.appcompat.app.AppCompatActivity
  import android.os.Bundle
  import android.widget.TextView
  import getDate// function from our Shared Module
  
  class MainActivity : AppCompatActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          findViewById&lt;TextView&gt;(R.id.dateLbl).text = getDate()
      }
  }
  </code></pre>
  <p>Any help or advice as to why the platform libraries won't work will be highly appreciated.</p>