title: twitter4j => AndroidRuntime(446): java.lang.NoClassDefFoundError: twitter4j.http.AccessToken
body: <p>I am trying to use twitter4j for my app to connect and post to twitter. I am following <a href="http://blog.doityourselfandroid.com/2011/02/13/guide-to-integrating-twitter-android-application/" rel="nofollow">this tutorial</a>. I have downloaded the example project from <a href="https://github.com/ddewaele/AndroidTwitterSample" rel="nofollow">here</a> and try to run it on <code>android 2.3.3</code>. I am sure that i have modified <code>Constants.java</code> file correctly according to my twitter developer website. In <code>TwitterUtils.java</code> i have enter <code>OAUTH_TOKEN</code> and <code>OAUTH_TOKEN_SECRET</code> also. but after running it, i got following error messages :</p>
  
  <pre><code>&gt; E/dalvikvm(374): Could not find class 'twitter4j.http.AccessToken', referenced from method com.ecs.android.sample.twitter.TwitterUtils.isAuthenticated
  
  &gt;W/dalvikvm(374): VFY: unable to resolve new-instance 67 (Ltwitter4j/http/AccessToken;) in Lcom/ecs/android/sample/twitter/TwitterUtils;
  
  &gt;D/dalvikvm(374): VFY: replacing opcode 0x22 at 0x0010
  
  &gt;D/dalvikvm(374): VFY: dead code 0x0012-002f in Lcom/ecs/android/sample/twitter/TwitterUtils;.isAuthenticated (Landroid/content/SharedPreferences;)Z
  
  &gt;E/dalvikvm(374): Could not find class 'twitter4j.http.AccessToken', referenced from method com.ecs.android.sample.twitter.TwitterUtils.sendTweet
  
  &gt;W/dalvikvm(374): VFY: unable to resolve new-instance 67 (Ltwitter4j/http/AccessToken;) in Lcom/ecs/android/sample/twitter/TwitterUtils;
  
  &gt;D/dalvikvm(374): VFY: replacing opcode 0x22 at 0x0010
  
  &gt;D/dalvikvm(374): VFY: dead code 0x0012-002b in Lcom/ecs/android/sample/twitter/TwitterUtils;.sendTweet (Landroid/content/SharedPreferences;Ljava/lang/String;)V
  
  &gt;D/AndroidRuntime(374): Shutting down VM
  
  &gt;W/dalvikvm(374): threadid=1: thread exiting with uncaught exception (group=0x40015560)
  
  &gt;E/AndroidRuntime(374): FATAL EXCEPTION: main
  
  &gt;E/AndroidRuntime(374): java.lang.NoClassDefFoundError: twitter4j.http.AccessToken
  
  &gt;E/AndroidRuntime(374):     at com.ecs.android.sample.twitter.TwitterUtils.isAuthenticated(TwitterUtils.java:18)
  
  &gt;E/AndroidRuntime(374):     at com.ecs.android.sample.twitter.AndroidTwitterSample.updateLoginStatus(AndroidTwitterSample.java:72)
  
  &gt;E/AndroidRuntime(374):     at com.ecs.android.sample.twitter.AndroidTwitterSample.onResume(AndroidTwitterSample.java:68)
  
  &gt;E/AndroidRuntime(374):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
  
  &gt;E/AndroidRuntime(374):     at android.app.Activity.performResume(Activity.java:3832)
  
  &gt;E/AndroidRuntime(374):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
  
  &gt;E/AndroidRuntime(374):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
  
  &gt;E/AndroidRuntime(374):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
  
  &gt;E/AndroidRuntime(374):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  
  &gt;E/AndroidRuntime(374):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
  
  &gt;E/AndroidRuntime(374):     at android.os.Handler.dispatchMessage(Handler.java:99)
  
  &gt;E/AndroidRuntime(374):     at android.os.Looper.loop(Looper.java:130)
  
  &gt;E/AndroidRuntime(374):     at android.app.ActivityThread.main(ActivityThread.java:3683)
  
  &gt;E/AndroidRuntime(374):     at java.lang.reflect.Method.invokeNative(Native Method)
  
  &gt;E/AndroidRuntime(374):     at java.lang.reflect.Method.invoke(Method.java:507)
  
  &gt;E/AndroidRuntime(374):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  
  &gt;E/AndroidRuntime(374):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  
  &gt;E/AndroidRuntime(374):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>am not sure if i am wrong, in Constant.java, i haven't change anything in </p>
  
  <pre><code>public static final String REQUEST_URL = "https://api.twitter.com/oauth/request_token";
  
  public static final String ACCESS_URL = "https://api.twitter.com/oauth/access_token";
  
  public static final String AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize";
  
  public static final String OAUTH_CALLBACK_SCHEME = "x-oauthflow-twitter";
  
  public static final String OAUTH_CALLBACK_HOST = "callback";
  
  public static final String OAUTH_CALLBACK_URL = OAUTH_CALLBACK_SCHEME + "://" + OAUTH_CALLBACK_HOST;
  </code></pre>
  
  <p>I have tried changing <code>"callback"</code> with <code>"http://www.MyWebsite.com"</code>
  Please advice how can I correct these problems.</p>