title: Android external library reference and NoClassDefFoundError
body: <p>I'm trying to test out this api: <a href="http://code.google.com/p/google-api-spelling-java/" rel="nofollow">http://code.google.com/p/google-api-spelling-java/</a> in Android. I created a new app and copied the library and dependencies from the prev url to the project's "libs" directory then added references to them through Java Build Path->Libraries->Add jars...</p>
  
  <p>Here's the test Activity:</p>
  
  <pre><code>package com.jimmcgowen.googleapispelling;
  
  import org.xeustechnologies.googleapi.spelling.SpellChecker;
  import org.xeustechnologies.googleapi.spelling.SpellCorrection;
  import org.xeustechnologies.googleapi.spelling.SpellResponse;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.util.Log;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.LinearLayout;
  import android.widget.TextView;
  
  public class MainActivity extends Activity {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Log.i("classpath", System.getProperty("java.class.path") );
      }
  
      public void onDoIt(View view) {
          EditText input = (EditText)findViewById( R.id.PlainText );
          String word = input.getText().toString().trim();
  
          SpellChecker checker = new SpellChecker();
          SpellResponse spellResponse = checker.check( word );
  
          for (SpellCorrection sc : spellResponse.getCorrections()) {
              Log.i("Spell Checker", sc.getValue());
  
              TextView tv = new TextView( this );
              tv.setText( sc.getValue() );
  
              LinearLayout container = (LinearLayout)findViewById( R.id.ResultContainer );
              container.addView( tv );
          }
      }
  }
  </code></pre>
  
  <p>Which compiles fine but when I run it I get:</p>
  
  <pre><code>07-22 16:16:48.673: E/dalvikvm(29209): Could not find class 'org.xeustechnologies.googleapi.spelling.SpellChecker', referenced from method com.jimmcgowen.googleapispelling.MainActivity.onDoIt
  07-22 16:16:48.703: W/dalvikvm(29209): VFY: unable to resolve new-instance 28 (Lorg/xeustechnologies/googleapi/spelling/SpellChecker;) in Lcom/jimmcgowen/googleapispelling/MainActivity;
  07-22 16:16:48.713: D/dalvikvm(29209): VFY: replacing opcode 0x22 at 0x0015
  07-22 16:16:48.713: D/dalvikvm(29209): VFY: dead code 0x0017-004c in Lcom/jimmcgowen/googleapispelling/MainActivity;.onDoIt (Landroid/view/View;)V
  07-22 16:16:48.903: I/classpath(29209): .
  07-22 16:16:48.903: D/ATRecorder(29209): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40529128
  07-22 16:16:53.948: D/AndroidRuntime(29209): Shutting down VM
  07-22 16:16:53.958: W/dalvikvm(29209): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
  07-22 16:16:53.978: E/AndroidRuntime(29209): FATAL EXCEPTION: main
  07-22 16:16:53.978: E/AndroidRuntime(29209): java.lang.IllegalStateException: Could not execute method of the activity
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at android.view.View$1.onClick(View.java:2192)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at android.view.View.performClick(View.java:2533)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at android.view.View$PerformClick.run(View.java:9299)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at android.os.Handler.handleCallback(Handler.java:587)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at android.os.Handler.dispatchMessage(Handler.java:92)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at android.os.Looper.loop(Looper.java:150)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at android.app.ActivityThread.main(ActivityThread.java:4352)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at java.lang.reflect.Method.invokeNative(Native Method)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at java.lang.reflect.Method.invoke(Method.java:507)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at dalvik.system.NativeStart.main(Native Method)
  07-22 16:16:53.978: E/AndroidRuntime(29209): Caused by: java.lang.reflect.InvocationTargetException
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at java.lang.reflect.Method.invokeNative(Native Method)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at java.lang.reflect.Method.invoke(Method.java:507)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at android.view.View$1.onClick(View.java:2187)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    ... 11 more
  07-22 16:16:53.978: E/AndroidRuntime(29209): Caused by: java.lang.NoClassDefFoundError: org.xeustechnologies.googleapi.spelling.SpellChecker
  07-22 16:16:53.978: E/AndroidRuntime(29209):    at com.jimmcgowen.googleapispelling.MainActivity.onDoIt(MainActivity.java:29)
  07-22 16:16:53.978: E/AndroidRuntime(29209):    ... 14 more
  </code></pre>
  
  <p>Notice that classpath is empty at runtime. I think this is where the problem lies but I'm not sure where to go from here.</p>
  
  <p>Using API level 8
  SDK tools 20
  Platform tools 13
  and I just updated the eclipe plugin.</p>