Twitter 集成错误
Twitter api 与我自己的应用程序集成时出现以下错误! 所有库都放置在项目中仍然出现错误!
有什么解决办法吗??
使用了 twitter4j n outh !
我已经添加了所有库,但仍然出现错误, 但如果我单独运行 twitter api ,它会正常运行!
但是当我集成到任何应用程序中时,同样的错误就会出现!!!!
我应该怎么办 ??
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(Method.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)
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(Method.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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚遇到了类似的问题。
除了将 JAR 文件添加到项目中之外,您还必须确保它将包含在 apk 文件中:
转到您的项目属性 -> Java 构建路径 -> Order and Export 选项卡,并确保选中 twitter4j JAR 文件旁边的框。
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.
您需要通过右键单击 Eclipse 中的项目 -> 来配置构建路径构建路径->配置构建路径->去图书馆 ->添加罐子->添加twitter的jar文件。
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.