我使用twitter4j库与twitter合作。但我有一个关于AccesToken类的问题。我检查了我的库,只有一个AccesToken类,它在twitter4j.http中 没有其他AccesToken类。 我的代码大约在10个小时前工作,但现在它不起作用。我快要发疯了:/
这是我的日志跟踪:
04-24 15:53:32.767: E/dalvikvm(305): Could not find class 'twitter4j.http.AccessToken', referenced from method com.twitterresim.TwitterOnay.isAuthenticated
04-24 15:53:32.767: W/dalvikvm(305): VFY: unable to resolve new-instance 67 (Ltwitter4j/http/AccessToken;) in Lcom/twitterresim/TwitterOnay;
04-24 15:53:32.767: D/dalvikvm(305): VFY: replacing opcode 0x22 at 0x0010
04-24 15:53:32.767: D/dalvikvm(305): Making a copy of Lcom/twitterresim/TwitterOnay;.isAuthenticated code (124 bytes)
04-24 15:53:32.767: E/dalvikvm(305): Could not find class 'twitter4j.http.AccessToken', referenced from method com.twitterresim.TwitterOnay.sendTweet
04-24 15:53:32.767: W/dalvikvm(305): VFY: unable to resolve new-instance 67 (Ltwitter4j/http/AccessToken;) in Lcom/twitterresim/TwitterOnay;
04-24 15:53:32.767: D/dalvikvm(305): VFY: replacing opcode 0x22 at 0x0010
04-24 15:53:32.767: D/dalvikvm(305): Making a copy of Lcom/twitterresim/TwitterOnay;.sendTweet code (104 bytes)
04-24 15:53:32.767: D/AndroidRuntime(305): Shutting down VM
04-24 15:53:32.767: W/dalvikvm(305): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-24 15:53:32.776: E/AndroidRuntime(305): Uncaught handler: thread main exiting due to uncaught exception
04-24 15:53:32.786: E/AndroidRuntime(305): java.lang.NoClassDefFoundError: twitter4j.http.AccessToken
04-24 15:53:32.786: E/AndroidRuntime(305): at com.twitterresim.TwitterOnay.isAuthenticated(TwitterOnay.java:18)
04-24 15:53:32.786: E/AndroidRuntime(305): at com.twitterresim.TwitterPost.TwitterUpdate(TwitterPost.java:38)
04-24 15:53:32.786: E/AndroidRuntime(305): at com.twitterresim.TwitterResimActivity$1.onClick(TwitterResimActivity.java:23)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.view.View.performClick(View.java:2364)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.view.View.onTouchEvent(View.java:4179)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.widget.TextView.onTouchEvent(TextView.java:6541)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.view.View.dispatchTouchEvent(View.java:3709)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
04-24 15:53:32.786: E/AndroidRuntime(305): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
04-24 15:53:32.786: E/AndroidRuntime(305): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
04-24 15:53:32.786: E/AndroidRuntime(305): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.os.Handler.dispatchMessage(Handler.java:99)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.os.Looper.loop(Looper.java:123)
04-24 15:53:32.786: E/AndroidRuntime(305): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-24 15:53:32.786: E/AndroidRuntime(305): at java.lang.reflect.Method.invokeNative(Native Method)
04-24 15:53:32.786: E/AndroidRuntime(305): at java.lang.reflect.Method.invoke(Method.java:521)
04-24 15:53:32.786: E/AndroidRuntime(305): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-24 15:53:32.786: E/AndroidRuntime(305): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-24 15:53:32.786: E/AndroidRuntime(305): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:4)
尝试将“lib”文件夹名称重命名为“libs”。这解决了我的问题,请点击此处: https://github.com/ddewaele/AndroidTwitterSample/issues/2