title: Compiling Kotlin file to Dex generates ClassNotFoundException (kotlin.jvm.internal.Intrinsics)
body: <p>I'm trying to create a command line script to run on my Android device. I'm following this <a href="https://stackoverflow.com/questions/10199863/how-to-execute-the-dex-file-in-android-with-command">answer</a> to run the compiled kotlin file with Dalvik VM, but I'm getting the following error when I run <code>dalvikvm -cp TestKt.zip</code> on adb shell:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
      at TestKt.main(Unknown Source:2)
  Caused by: java.lang.ClassNotFoundException: Didn't find class
  "kotlin.jvm.internal.Intrinsics" on path: DexPathList[[zip file "TestKt.zip"],
  nativeLibraryDirectories=[/system/lib64, /system/vendor/lib64, 
  /system/lib64, /system/vendor/lib64]]
      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
      ... 1 more
  </code></pre>
  
  <p>This is the simple file (Test.kt) that I'm trying to compile:</p>
  
  <pre><code>package edu.ufrn.lapps
  
  fun main(args: Array&lt;String&gt;) {
      println(args.size);
  }
  </code></pre>
  
  <p>I wrote a Makefile to compile it (mainly because this is just a test, but I'll probably move to Gradle once I need dependencies):</p>
  
  <pre><code>NAME := TestKt
  OUTPUT := TestKt
  
  PKG := edu/ufrn/lapps
  KFLAGS := -include-runtime
  
  D8C := $(HOME)/Android/Sdk/build-tools/29.0.1/d8
  D8FLAGS := --no-desugaring 
  
  dex:
      kotlinc src/$(PKG)/Test.kt
      $(D8C) $(D8FLAGS) $(PKG)/$(OUTPUT).class
  
  zip: dex 
      zip $(OUTPUT).zip classes.dex
  
  jvm:
      kotlinc $(SRC)/Test.kt $(KFLAGS) -d $(OUTPUT).jar
  
  .PHONY: clean
  
  clean:
      -rm -r META-INF/
      -rm $(OUTPUT).jar $(OUTPUT).zip
  </code></pre>
  
  <p>I'm trying to follow the <a href="https://github.com/aosp-mirror/platform_frameworks_base/tree/master/cmds/input" rel="nofollow noreferrer">AOSP cmds</a> to make my CLI script, but I've never compiled Java bytecode to Dex before, so I'm not sure if this is the right way to do it.</p>
  
  <p>How should I go about fixing this error?</p>