Twitter integration error
Following error coming while , Twitter api integrating with my own application !! and all library are place in project still getting error !
any solution plz ??
twitter4j n outh was used !
I already added all libraries , still error coming , But if i separately run twitter api , its run normal way !!
But when i integrated in any app ,that time same error is coming !!!!!
What should i do ??
10-04 10:58:54.524: ERROR/dalvikvm(844): Could not find class 'twitter4j.TwitterFactory', referenced from method com.jcp.dp.android.twitter.TwitterUtils.isAuthenticated
10-04 10:58:54.524: WARN/dalvikvm(844): VFY: unable to resolve new-instance 1102 (Ltwitter4j/TwitterFactory;) in Lcom/jcp/dp/android/twitter/TwitterUtils;
10-04 10:58:54.524: DEBUG/dalvikvm(844): VFY: replacing opcode 0x22 at 0x0017
10-04 10:58:54.524: DEBUG/dalvikvm(844): Making a copy of Lcom/jcp/dp/android/twitter/TwitterUtils;.isAuthenticated code (193 bytes)
10-04 10:58:54.524: ERROR/dalvikvm(844): Could not find class 'twitter4j.auth.AccessToken', referenced from method com.jcp.dp.android.twitter.TwitterUtils.sendTweet
10-04 10:58:54.524: WARN/dalvikvm(844): VFY: unable to resolve new-instance 1103 (Ltwitter4j/auth/AccessToken;) in Lcom/jcp/dp/android/twitter/TwitterUtils;
10-04 10:58:54.524: DEBUG/dalvikvm(844): VFY: replacing opcode 0x22 at 0x0010
10-04 10:58:54.524: DEBUG/dalvikvm(844): Making a copy of Lcom/jcp/dp/android/twitter/TwitterUtils;.sendTweet code (104 bytes)
10-04 10:58:54.524: DEBUG/TAG19(844): yes
10-04 10:58:54.534: DEBUG/AndroidRuntime(844): Shutting down VM
10-04 10:58:54.534: WARN/dalvikvm(844): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
10-04 10:58:54.534: ERROR/AndroidRuntime(844): Uncaught handler: thread main exiting due to uncaught exception
10-04 10:58:54.544: ERROR/AndroidRuntime(844): java.lang.NoClassDefFoundError: twitter4j.TwitterFactory
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at com.jcp.dp.android.twitter.TwitterUtils.isAuthenticated(TwitterUtils.java:23)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at com.jcp.dp.android.twitter.AndroidTwitterSample$1.onClick(AndroidTwitterSample.java:43)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.View.performClick(View.java:2364)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.View.onTouchEvent(View.java:4179)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.widget.TextView.onTouchEvent(TextView.java:6540)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.View.dispatchTouchEvent(View.java:3709)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.os.Handler.dispatchMessage(Handler.java:99)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.os.Looper.loop(Looper.java:123)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at android.app.ActivityThread.main(ActivityThread.java:4363)
.
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at java.lang.reflect.Method.invokeNative(Native Method)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at java.lang.reflect.Method.invoke(M开发者_开发问答ethod.java:521)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
10-04 10:58:54.544: ERROR/AndroidRuntime(844): at dalvik.system.NativeStart.main(Native Method)
I just came across a similar issue.
In addition to adding the JAR file to the project you have to make sure that it will be included in the apk file:
Go to your project properties -> Java Build Path -> Order and Export tab, and ensure the box next to the twitter4j JAR file is checked.
you need to configure the build path by right clicking on the project in eclipse -> buildpath -> configure build path -> go to libraries -> add jars -> add the jar file of the twitter.
精彩评论