Having Problem to Run JTwitter.jar in Android.
-
I am trying to run this coding in Android... public void onClick(View v) { final String status = editstatus.getText().toString(); new Thread() { public void run() { try { Twitter twitter = new Twitter("student", "password"); twitter.setAPIRootUrl("yamba.marakana.com/api"); twitter.setStatus(status); } catch (TwitterException e) { Log.d("StatusActivity", "TwitterException" + e); e.printStackTrace(); } } }.start(); Log.d("StatusActivity", "onClicked " + status); } // and i get the error 05-11 16:47:20.526: D/gralloc_goldfish(1037): Emulator without GPU emulation detected. 05-11 16:47:21.455: W/IInputConnectionWrapper(1037): showStatusIcon on inactive InputConnection 05-11 16:56:26.915: E/dalvikvm(1037): Could not find class 'winterwell.jtwitter.Twitter', referenced from method com.example.listviews2.StatusActivity$1.run 05-11 16:56:26.915: W/dalvikvm(1037): VFY: unable to resolve new-instance 562 (Lwinterwell/jtwitter/Twitter;) in Lcom/example/listviews2/StatusActivity$1; 05-11 16:56:26.925: D/dalvikvm(1037): VFY: replacing opcode 0x22 at 0x0000 05-11 16:56:26.925: W/dalvikvm(1037): VFY: unable to resolve exception class 563 (Lwinterwell/jtwitter/TwitterException;) 05-11 16:56:26.925: W/dalvikvm(1037): VFY: unable to find exception handler at addr 0x14 05-11 16:56:26.925: W/dalvikvm(1037): VFY: rejected Lcom/example/listviews2/StatusActivity$1;.run ()V 05-11 16:56:26.938: W/dalvikvm(1037): VFY: rejecting opcode 0x0d at 0x0014 05-11 16:56:26.938: W/dalvikvm(1037): VFY: rejected Lcom/example/listviews2/StatusActivity$1;.run ()V 05-11 16:56:26.938: W/dalvikvm(1037): Verifier rejected class Lcom/example/listviews2/StatusActivity$1; 05-11 16:56:26.938: D/AndroidRuntime(1037): Shutting down VM 05-11 16:56:26.938: W/dalvikvm(1037): threadid=1: thread exiting with uncaught exception (group=0x409961f8) 05-11 16:56:26.984: E/AndroidRuntime(1037): FATAL EXCEPTION: main 05-11 16:56:26.984: E/AndroidRuntime(1037): java.lang.IllegalStateException: Could not execute method of the activity 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.view.View$1.onClick(View.java:3039) 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.view.View.performClick(View.java:3480) 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.view.View$PerformClick.run(View.java:13983) 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.os.Handler.handleCallback(Handler.java:605) 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.os.Handler.d
-
I am trying to run this coding in Android... public void onClick(View v) { final String status = editstatus.getText().toString(); new Thread() { public void run() { try { Twitter twitter = new Twitter("student", "password"); twitter.setAPIRootUrl("yamba.marakana.com/api"); twitter.setStatus(status); } catch (TwitterException e) { Log.d("StatusActivity", "TwitterException" + e); e.printStackTrace(); } } }.start(); Log.d("StatusActivity", "onClicked " + status); } // and i get the error 05-11 16:47:20.526: D/gralloc_goldfish(1037): Emulator without GPU emulation detected. 05-11 16:47:21.455: W/IInputConnectionWrapper(1037): showStatusIcon on inactive InputConnection 05-11 16:56:26.915: E/dalvikvm(1037): Could not find class 'winterwell.jtwitter.Twitter', referenced from method com.example.listviews2.StatusActivity$1.run 05-11 16:56:26.915: W/dalvikvm(1037): VFY: unable to resolve new-instance 562 (Lwinterwell/jtwitter/Twitter;) in Lcom/example/listviews2/StatusActivity$1; 05-11 16:56:26.925: D/dalvikvm(1037): VFY: replacing opcode 0x22 at 0x0000 05-11 16:56:26.925: W/dalvikvm(1037): VFY: unable to resolve exception class 563 (Lwinterwell/jtwitter/TwitterException;) 05-11 16:56:26.925: W/dalvikvm(1037): VFY: unable to find exception handler at addr 0x14 05-11 16:56:26.925: W/dalvikvm(1037): VFY: rejected Lcom/example/listviews2/StatusActivity$1;.run ()V 05-11 16:56:26.938: W/dalvikvm(1037): VFY: rejecting opcode 0x0d at 0x0014 05-11 16:56:26.938: W/dalvikvm(1037): VFY: rejected Lcom/example/listviews2/StatusActivity$1;.run ()V 05-11 16:56:26.938: W/dalvikvm(1037): Verifier rejected class Lcom/example/listviews2/StatusActivity$1; 05-11 16:56:26.938: D/AndroidRuntime(1037): Shutting down VM 05-11 16:56:26.938: W/dalvikvm(1037): threadid=1: thread exiting with uncaught exception (group=0x409961f8) 05-11 16:56:26.984: E/AndroidRuntime(1037): FATAL EXCEPTION: main 05-11 16:56:26.984: E/AndroidRuntime(1037): java.lang.IllegalStateException: Could not execute method of the activity 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.view.View$1.onClick(View.java:3039) 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.view.View.performClick(View.java:3480) 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.view.View$PerformClick.run(View.java:13983) 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.os.Handler.handleCallback(Handler.java:605) 05-11 16:56:26.984: E/AndroidRuntime(1037): at android.os.Handler.d
Hello, Make sure that all required dependencies are bundled with your apk file. The error clearly indicates that the program was unable to resolve/load the requested class. Regards,
Prasad P. Khandekar Knowledge exists, man only discovers it.