Android Twitter4j Error
I am getting following error while updating my twitter status from java code in android using Twitter4J .
Any help will be appreciated.....
09-18 11:34:50.476: WARN/System.err(755): TwitterException{exceptionCode=[15bb6564-00e4d61f], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.5-SNAPSHOT(build: d372a51b9b419cbd73d416474f4a855f3e889507)}
09-18 11:34:50.476: WARN/System.err(755): at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:308)
09-18 11:34:50.496: WARN/System.err(755): at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:72)
09-18 11:34:50.496: WARN/System.err(755): at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:103)
09-18 11:34:50.496: WARN/System.err(755): at twitter4j.Twitter.updateStatus(Twitter.java:500)
09-18 11:34:50.496: WARN/System.err(755): at com.android.twitterTest.twitterTest.postUpdate(twitterTest.java:115)
09-18 11:34:50.510: WARN/System.err(755): at com.android.twitterTest.twitterTest$1.onClick(twitterTest.java:50)
09-18 11:34:50.510: WARN/System.err(755): at android.view.View.performClick(View.java:2408)
09-18 11:34:50.510: WARN/System.err(755): at android.view.View$PerformClick.run(View.java:8816)
09-18 11:34:50.510: WARN/System.err(755): at android.os.Handler.handleCallback(Handler.java:587)
09-18 11:34:50.536: WARN/System.err(755): at android.os.Handler.dispatchMessage(Handler.java:92)
09-18 11:34:50.536: WARN开发者_如何学Python/System.err(755): at android.os.Looper.loop(Looper.java:123)
09-18 11:34:50.536: WARN/System.err(755): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-18 11:34:50.536: WARN/System.err(755): at java.lang.reflect.Method.invokeNative(Native Method)
09-18 11:34:50.536: WARN/System.err(755): at java.lang.reflect.Method.invoke(Method.java:521)
09-18 11:34:50.536: WARN/System.err(755): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-18 11:34:50.536: WARN/System.err(755): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-18 11:34:50.536: WARN/System.err(755): at dalvik.system.NativeStart.main(Native Method)
09-18 11:34:50.596: INFO/Exception(755): TwitterException{exceptionCode=[15bb6564-00e4d61f], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.5-SNAPSHOT(build: d372a51b9b419cbd73d416474f4a855f3e889507)}
09-18 11:36:38.517: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
09-18 11:41:38.527: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
09-18 11:42:49.207: DEBUG/ThrottleService(60): onPollAlarm - roaming =false, read =0, written =0, new total =0
09-18 11:46:38.530: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
Per https://apiwiki.twitter.com/HTTP-Response-Codes-and-Errors: status code 401
means the authentication credentials were missing or incorrect. Make sure you're successfully connecting via OAuth.
I was facing the same problem. But signing out and then signing in again worked for me. Now my app is working and error is removed.
精彩评论