title: NoClassDefFoundError at runtime but class is in classes.dex, what givies?
body: <p>I have included a JAR file built from an Eclipse Android project, and I am referencing it in my Android Studio project like the following:</p>
  
  <pre><code>  compile files('libs/libraryproject.jar')
  </code></pre>
  
  <p>This works, and I am able to get auto-complete on code references. When I compile the APK everything is fine. I install and run, and then receive a no class def error:</p>
  
  <pre><code> java.lang.NoClassDefFoundError: com.android.canvas.CanvasContainer
              at com.app.MainActivity.onCreate(MainActivity.java:22)
              at android.app.Activity.performCreate(Activity.java:5231)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
              at android.app.ActivityThread.access$800(ActivityThread.java:135)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:136)
              at android.app.ActivityThread.main(ActivityThread.java:5017)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>However, when I unzip the APK, and use dexdump to view the classes.dex file, I see that the above class exists there. </p>
  
  <p>Why then am I getting this class not found error at runtime? </p>
  
  <p><strong>Update</strong>:</p>
  
  <p>Thanks to Chris's suggestion I noticed that earlier in the logs, my CanvasContainer class could not be linked due to it not being able to resolve  <code>interface 1990 'Lorg/cocos2dx/lib/Cocos2dxHelper$Cocos2dxHelperListener;'</code>. Pretty apparently it looks like my Cocos library code is not getting exported as part of my JAR.</p>