title: NoClassDefFoundError kotlinx serialization
body: <p>I have a kotlin multiplatform project and I need to <code>serialize</code> a class. I have included the following dependency in my <code>commonMain</code> and <code>androidMain</code> and <code>iosMain</code> respectively in my <code>multiplatform gradle file</code>:</p>
  <pre><code> //commonMain
   implementation &quot;org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:0.20.0&quot;
  
   //androidMain
   implementation &quot;org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0&quot;
  
   //iosMain
   implementation &quot;org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.20.0&quot;
  </code></pre>
  <p>This is the class I want to <code>serialize</code>:</p>
  <pre><code>@Serializable
  class Test {
  
      fun toJsonTestClass() = Json.stringify(Test.serializer(), this)
      var value1:Double = 0.toDouble()
         
      companion object {
  
          fun buildClass(value1 : Double):Test {
  
              val test = Test()
              test.value1 = value1
     
              return test
          }
  
           fun fromJsonTestClass(json:String) = Json.parse(Test.serializer(), json)
      }
  }
  </code></pre>
  <p>And in another class (<code>TrialClass</code>), this is how I am testing it:</p>
  <pre><code>val test = Test()
  val testToJson = test.toJsonTestClass() //&lt;- This is where the error is pointing to.
  
  println(testToJson)
  </code></pre>
  <p>But when I run it, I get the following error:</p>
  <blockquote>
  <pre><code>Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: kotlinx/serialization/json/Json
    at Test.toJsonTestClass(Test.kt:28)
    at TrialClass.main(TrialClass.kt:4)
  Caused by: java.lang.ClassNotFoundException: kotlinx.serialization.json.Json
  </code></pre>
  </blockquote>
  <p>I get no issues when having the imports in my class, but when running I get the above mentioned error.</p>
  <p>Any help or advice will be highly appreciated.</p>