Android Twitter4j 401身份验证错误

时间:2012-08-01 18:31:30

标签: android oauth twitter-oauth twitter4j

我正在https://github.com/lorensiuswlt/AndroidTwitter使用AndroidTwitter项目连接到Twitter并发送推文。我可以成功地使用Twitter授权,它说我已经登录,但是当我发布推文时,我收到了这个错误。 Android设备上的系统时间是正确的,并填写了我的oauth密钥和密码(登录时没有问题。)

08-01 14:25:07.222: W/System.err(5527): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
08-01 14:25:07.222: W/System.err(5527): error - Could not authenticate with OAuth.
08-01 14:25:07.222: W/System.err(5527): request - /1/statuses/update.json
08-01 14:25:07.222: W/System.err(5527): Relevant discussions can be found on the Internet at:
08-01 14:25:07.222: W/System.err(5527):     http://www.google.co.jp/search?q=b2b52c28 or
08-01 14:25:07.222: W/System.err(5527):     http://www.google.co.jp/search?q=1a591522
08-01 14:25:07.222: W/System.err(5527): TwitterException{exceptionCode=[b2b52c28-1a591522],     statusCode=401, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=3.0.0-SNAPSHOT(build: a5aafcad15add0fbc7a6583e337a1abbafa23435)}
08-01 14:25:07.229: W/System.err(5527):     at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:176)
08-01 14:25:07.229: W/System.err(5527):     at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
08-01 14:25:07.229: W/System.err(5527):     at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:98)
08-01 14:25:07.229: W/System.err(5527):     at twitter4j.TwitterImpl.post(TwitterImpl.java:1970)
08-01 14:25:07.237: W/System.err(5527):     at twitter4j.TwitterImpl.updateStatus(TwitterImpl.java:415)
08-01 14:25:07.237: W/System.err(5527):     at net.londatiga.android.TwitterApp.updateStatus(TwitterApp.java:106)
08-01 14:25:07.237: W/System.err(5527):     at net.londatiga.android.TestPost$5.run(TestPost.java:106)

1 个答案:

答案 0 :(得分:0)

如果您刚刚设置它,您的Twitter应用程序可能仍设置为只读。在Twitter设置控制台中检查应用程序的应用程序类型。确保在更改后重新生成访问令牌。