与jTwitter为Android授权错误(Authorization error with jTw

2019-08-17 02:59发布

我用我的Android应用程序jTwitter库。 直到前天一切工作正常。 但是,今天我得到异常“服务提供商错误回答:301”。 请帮帮我。

这里是疗法堆栈跟踪:

02-21 21:07:27.258: E/AndroidRuntime(4013): FATAL EXCEPTION: AsyncTask #1
02-21 21:07:27.258: E/AndroidRuntime(4013): java.lang.RuntimeException: An error occured while executing doInBackground()
02-21 21:07:27.258: E/AndroidRuntime(4013):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.lang.Thread.run(Thread.java:856)
02-21 21:07:27.258: E/AndroidRuntime(4013): Caused by: winterwell.jtwitter.TwitterException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 301 (Moved Permanently)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at winterwell.jtwitter.OAuthSignpostClient.authorizeUrl(OAuthSignpostClient.java:307)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at com.example.retrieve.contacts.twitter.MainActivity$MyTask.doInBackground(MainActivity.java:363)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at com.example.retrieve.contacts.twitter.MainActivity$MyTask.doInBackground(MainActivity.java:1)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
02-21 21:07:27.258: E/AndroidRuntime(4013):     ... 5 more
02-21 21:07:27.258: E/AndroidRuntime(4013): Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 301 (Moved Permanently)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at winterwell.jtwitter.OAuthSignpostClient.authorizeUrl(OAuthSignpostClient.java:303)
02-21 21:07:27.258: E/AndroidRuntime(4013):     ... 9 more
02-21 21:07:27.258: E/AndroidRuntime(4013): Caused by: oauth.signpost.exception.OAuthCommunicationException: Service provider responded in error: 301 (Moved Permanently)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:241)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)

Answer 1:

Twitter的改变了自己的API。 这是对OAuth的URL一个微不足道的,但恼人的变化。

这是固定的(2.7)的最新版本JTwitter的-你可以从下载JTwitter网页



文章来源: Authorization error with jTwitter for android