title: com.android.build.api.transform.TransformException: java.lang.RuntimeException: Unable to pre-dex
body: <p>Facing this issue while I am upgrading my Android project. Upgraded following config till now:</p>
  
  <ol>
  <li>Kotlin v.1.1.60 to v.1.2.41 </li>
  <li>along with above change I added plugin <code>apply plugin: 'kotlin-kapt'</code> and replaced <code>annotationProcessor</code> to <code>kapt</code></li>
  <li>Upgraded dependency <code>compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"</code> to <code>compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"</code> as I got the warning that <code>"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"</code> was deprecated for new Kotlin version</li>
  </ol>
  
  <p>Uptill now, my project isworking i.e. getting compiled and APK is getting generated. Now I made following changes:</p>
  
  <ol>
  <li>Upgraded Realm from v.2.2.2 to v.5.1.0</li>
  <li><p>At this stage, my project was not getting compiled. For classes such as <code>Realm</code>, <code>RealmResults</code> I was getting 'unresolved reference'. Then I added below code in application's build.gradle</p>
  
  <p>realm {
  syncEnabled = true
  }</p></li>
  </ol>
  
  <p>Now 'unresolved reference' is resolved but I am getting above error mentioned in the question. </p>
  
  <pre><code>Caused by: com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex '/Users/macusername/.android/build-cache/1356d0bbf59bd3c075dd3c13537428b6de3f0678/output/jars/classes.jar' to '/Users/macusername/AndroidProjects/project-name/app/build/intermediates/transforms/dex/flavour-name/debugSIT/folders/1000/10/classes_3ca2264d84fdd4905c647b112b0d3c683ba517e0'
  </code></pre>