Java – Twitter error when posting a message in Android?

Twitter error when posting a message in Android?… here is a solution to the problem.

Twitter error when posting a message in Android?

I’m using twitter4j.jar to post messages in twitter. But when I post a message in twitter, my log-cat shows an error. How do I fix this. Can someone help me?

OAuth - Error sending to Twitter
410:
Relevant discussions can be on the Internet at:
http://www.google.co.jp/search?q=15bb6564 or http://www.google.co.jp/search?q=010f3e5b
TwitterException{exceptionCode=[15bb6564-010f3e5b], statusCode=410, retryAfter=0, rateLimitStatus=null, version=2.1.11}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:199)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:75)
at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:112)
at twitter4j. Twitter.updateStatus(Twitter.java:593)
at com.android.abchealthgroup.facebook_twitter_post. TwitterUtils.sendTweet(TwitterUtils.java:40)
at com.android.abchealthgroup.facebook_twitter_post. PrepareRequestTokenActivity$RetrieveAccessTokenTask.executeAfterAccessTokenRetrieval(PrepareRequestTokenActivity.java:149)
at com.android.abchealthgroup.facebook_twitter_post. PrepareRequestTokenActivity$RetrieveAccessTokenTask.doInBackground(PrepareRequestTokenActivity.java:134)
at com.android.abchealthgroup.facebook_twitter_post. PrepareRequestTokenActivity$RetrieveAccessTokenTask.doInBackground(PrepareRequestTokenActivity.java:1)

Thanks in advance.

Solution

twitter4j-core-2.1.11 uses Twitter API 1.0, which was abandoned by twitter yesterday (see twitter’s announcement). In order to be able to use twitter in the future, you must upgrade the twitter4j library to one that supports the newer twitter API 1.1. This is the case with twitter4j version 3.0.x.

Related Problems and Solutions