Android Twitter4J(xAuth): one device works, one device doesn't
Here is the stacktrace:
06-16 14:44:20.462 5526 5535 W System.err: **The screen name / password combination seems to be invalid.** Relevant discussions can be on the Internet at:
06-16 14:44:20.462 5526 5535 W System.err: http://www.google.co.jp/search?q=96430884 or
06-16 14:44:20.462 5526 5535 W System.err: http://www.google.co.jp/search?q=000024ea
06-16 14:44:20.462 5526 5535 W System.err: TwitterException{exceptionCode=[96430884-000024ea 9aae86e9-10c613ce 9aae86e9-10c613a4], statusCo开发者_StackOverflow社区de=-1, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.3}
06-16 14:44:20.462 5526 5535 W System.err: at twitter4j.auth.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:181)
06-16 14:44:20.462 5526 5535 W System.err: at twitter4j.TwitterBaseImpl.getOAuthAccessToken(TwitterBaseImpl.java:299)
06-16 14:44:20.462 5526 5535 W System.err: at com.outware.wineregions.activities.NameAndPasswordActivity$2.doInBackground(NameAndPasswordActivity.java:107)
06-16 14:44:20.462 5526 5535 W System.err: at com.outware.wineregions.activities.NameAndPasswordActivity$2.doInBackground(NameAndPasswordActivity.java:1)
06-16 14:44:20.462 5526 5535 W System.err: at android.os.AsyncTask$2.call(AsyncTask.java:185)
06-16 14:44:20.462 5526 5535 W System.err: at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-16 14:44:20.462 5526 5535 W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-16 14:44:20.462 5526 5535 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
06-16 14:44:20.462 5526 5535 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
06-16 14:44:20.462 5526 5535 W System.err: at java.lang.Thread.run(Thread.java:1096)
06-16 14:44:20.462 5526 5535 W System.err: **Caused by: Host is unresolved: api.twitter.com:443** Relevant discussions can be on the Internet at:
06-16 14:44:20.462 5526 5535 W System.err: http://www.google.co.jp/search?q=9aae86e9 or
06-16 14:44:20.462 5526 5535 W System.err: http://www.google.co.jp/search?q=10c613ce
06-16 14:44:20.462 5526 5535 W System.err: TwitterException{exceptionCode=[9aae86e9-10c613ce 9aae86e9-10c613a4], statusCode=-1, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.3}
06-16 14:44:20.470 5526 5535 W System.err: at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:204)
06-16 14:44:20.470 5526 5535 W System.err: at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
06-16 14:44:20.470 5526 5535 W System.err: at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:102)
06-16 14:44:20.470 5526 5535 W System.err: at twitter4j.auth.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:174)
06-16 14:44:20.470 5526 5535 W System.err: ... 9 more
06-16 14:44:20.470 5526 5535 W System.err: Caused by: java.net.UnknownHostException: Host is unresolved: api.twitter.com:443
06-16 14:44:20.470 5526 5535 W System.err: at java.net.Socket.connect(Socket.java:1037)
06-16 14:44:20.470 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:62)
06-16 14:44:20.470 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:145)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:67)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:821)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:807)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection$HttpsEngine.connect(HttpsURLConnection.java:395)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.sendRequest(HttpURLConnection.java:1224)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequestInternal(HttpURLConnection.java:1558)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequest(HttpURLConnection.java:1551)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1145)
06-16 14:44:20.478 5526 5535 W System.err: at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection.getOutputStream(HttpsURLConnection.java:262)
06-16 14:44:20.478 5526 5535 W System.err: at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:162)
It works on one device, but on another device, it generates the above error, and yes, this app has been approved to use xauth on iPhone and I'm sure there is no problem with the key/secret pair as it works on another device.
Can anyone give me any suggestion? Thanks!
We had a similar problem though the cause may be different from yours.
In our case we have setup 2 Twitter applications, one for Production and another for Test. Production has xAuth enabled and Test doesn't. Devices that have the production app installed can sign in without any problem because obviously they are hitting an xAuth-enabled Twitter app. Whereas devices that have the test app installed get the same stack trace as yours.
You will also get this error if the clock on the Twitter client is (massively) out of sync. I just ran into this, where my handset was off for several weeks and the internal clock was set to Jan 1st 1980. Setting the clock correctly fixed the issue.
精彩评论