1

我正在编写一个 OAuth Twitter 应用程序,我一直收到这些错误:

" 用户尚未授予对该帐户的访问权限。"

我的问题是,在用户授权应用程序并且登录成功并且 Twitter 重定向到回调 URL(返回到我的应用程序中的 Twitter 主页时间线)后,我的应用程序崩溃了,应用程序崩溃了。可能是什么原因?

05-02 06:10:09.404: E/AndroidRuntime(570): FATAL EXCEPTION: main
05-02 06:10:09.404: E/AndroidRuntime(570): java.lang.RuntimeException: Unable to authorize user
05-02 06:10:09.404: E/AndroidRuntime(570):  at com.oreilly.android.otweet.OTweetApplication.authorized(OTweetApplication.java:57)
05-02 06:10:09.404: E/AndroidRuntime(570):  at com.oreilly.android.otweet.activities.AuthorizationActivity$1.onLoadResource(AuthorizationActivity.java:28)
05-02 06:10:09.404: E/AndroidRuntime(570):  at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:374)
05-02 06:10:09.404: E/AndroidRuntime(570):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-02 06:10:09.404: E/AndroidRuntime(570):  at android.os.Looper.loop(Looper.java:130)
05-02 06:10:09.404: E/AndroidRuntime(570):  at android.app.ActivityThread.main(ActivityThread.java:3683)
05-02 06:10:09.404: E/AndroidRuntime(570):  at java.lang.reflect.Method.invokeNative(Native Method)
05-02 06:10:09.404: E/AndroidRuntime(570):  at java.lang.reflect.Method.invoke(Method.java:507)
05-02 06:10:09.404: E/AndroidRuntime(570):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-02 06:10:09.404: E/AndroidRuntime(570):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-02 06:10:09.404: E/AndroidRuntime(570):  at dalvik.system.NativeStart.main(Native Method)
05-02 06:10:09.404: E/AndroidRuntime(570): Caused by: twitter4j.TwitterException: The user has not given access to the account.
05-02 06:10:09.404: E/AndroidRuntime(570):  at twitter4j.http.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:133)
05-02 06:10:09.404: E/AndroidRuntime(570):  at twitter4j.Twitter.getOAuthAccessToken(Twitter.java:1460)
05-02 06:10:09.404: E/AndroidRuntime(570):  at com.oreilly.android.otweet.OTweetApplication.authorized(OTweetApplication.java:54)
05-02 06:10:09.404: E/AndroidRuntime(570):  ... 10 more
05-02 06:10:09.404: E/AndroidRuntime(570): Caused by: twitter4j.TwitterException: 401:Authentication credentials were missing or incorrect.
05-02 06:10:09.404: E/AndroidRuntime(570): <?xml version="1.0" encoding="UTF-8"?>
05-02 06:10:09.404: E/AndroidRuntime(570): <hash>
05-02 06:10:09.404: E/AndroidRuntime(570):   <error>Required oauth_verifier parameter not provided</error>
05-02 06:10:09.404: E/AndroidRuntime(570):   <request>/oauth/access_token</request>
05-02 06:10:09.404: E/AndroidRuntime(570): </hash>
05-02 06:10:09.404: E/AndroidRuntime(570):  at twitter4j.internal.http.HttpClient.request(HttpClient.java:324)
05-02 06:10:09.404: E/AndroidRuntime(570):  at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:68)
05-02 06:10:09.404: E/AndroidRuntime(570):  at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:107)
05-02 06:10:09.404: E/AndroidRuntime(570):  at twitter4j.http.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:130)
05-02 06:10:09.404: E/AndroidRuntime(570):  ... 12 more
05-02 06:10:09.667: D/dalvikvm(570): GC_CONCURRENT freed 479K, 48% free 3249K/6215K, external 884K/1038K, paused 12ms+22ms
05-02 06:15:09.503: I/Process(570): Sending signal. PID: 570 SIG: 9
4

0 回答 0