title: Android Studio (IntelliJ), maven build tool: Failed to load dx.jar
body: <p>JDK 1.8</p>
  
  <p>IDEA CE version 2017.1</p>
  
  <p>Mac OSX 10.12.6</p>
  
  <p>Android API 22, 24, 26</p>
  
  <p>When building PhoneGap app for android (maven build tool), the app crashes with the following console output. I don't understand java debug output and I haven't found any resolution here or anywhere else for that matter. I think it's a bug with the tool. I can run the app with no problems when launched through Google Chrome. </p>
  
  <pre><code>Error:Android Pre Dex: [cordova-2.3.0.jar] Failed to load dx.jar
  Error:Android Pre Dex: [cordova-2.3.0.jar] java.lang.ClassNotFoundException: com.android.dx.command.DxConsole
  Error:Android Pre Dex: [cordova-2.3.0.jar] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  Error:Android Pre Dex: [cordova-2.3.0.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  Error:Android Pre Dex: [cordova-2.3.0.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  Error:Android Pre Dex: [cordova-2.3.0.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.loadDex(AndroidDxRunner.java:80)
  Error:Android Pre Dex: [cordova-2.3.0.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:136)
  Error:Android Pre Dex: [cordova-2.3.0.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:336)
  Error:Android Pre Dex: [cordova-2.3.0.jar] Exception in thread "main" java.lang.NullPointerException
  Error:Android Pre Dex: [cordova-2.3.0.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
  </code></pre>
  
  <p>For reference: <a href="https://youtrack.jetbrains.com/issue/IDEA-177053" rel="nofollow noreferrer">JetBrains bug report</a></p>