

私はandroid アプリ内に twitter SDK (1.8.0)を使ってtwitter#login() を実装したところ  
LG Electronics LGV32 で例外が発生しました。

Twitterアプリがインストールされていない端末なので標準ブラウザ立ち上がると思うのですが、立ち上がりません。

解決策をしらないでしょうか？

[code]

    09-25 16:30:09.491  29572-29572/PACKAGE E/Twitter﹕ Invalid json: <?xml version="1.0" encoding="UTF-8"?>
        <hash>
        <error>Desktop applications only support the oauth_callback value 'oob'</error>
        <request>/oauth/request_token</request>
        </hash>
        com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8 path $
                at com.google.gson.JsonParser.parse(JsonParser.java:65)
                at com.google.gson.JsonParser.parse(JsonParser.java:45)
                at com.twitter.sdk.android.core.TwitterApiException.parseApiError(TwitterApiException.java:136)
                at com.twitter.sdk.android.core.TwitterApiException.readApiError(TwitterApiException.java:125)
                at com.twitter.sdk.android.core.TwitterApiException.<init>(TwitterApiException.java:58)
                at com.twitter.sdk.android.core.TwitterApiException.convert(TwitterApiException.java:110)
                at com.twitter.sdk.android.core.Callback.failure(Callback.java:45)
                at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
                at android.os.Handler.handleCallback(Handler.java:739)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5430)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)
         Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8 path $
                at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1572)
                at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1421)
                at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:544)
                at com.google.gson.stream.JsonReader.peek(JsonReader.java:427)
                at com.google.gson.JsonParser.parse(JsonParser.java:60)
                at com.google.gson.JsonParser.parse(JsonParser.java:45)
                at com.twitter.sdk.android.core.TwitterApiException.parseApiError(TwitterApiException.java:136)
                at com.twitter.sdk.android.core.TwitterApiException.readApiError(TwitterApiException.java:125)
                at com.twitter.sdk.android.core.TwitterApiException.<init>(TwitterApiException.java:58)
                at com.twitter.sdk.android.core.TwitterApiException.convert(TwitterApiException.java:110)
                at com.twitter.sdk.android.core.Callback.failure(Callback.java:45)
                at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
                at android.os.Handler.handleCallback(Handler.java:739)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5430)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)
    09-25 16:30:09.491  29572-29572/PACKAGE E/Twitter﹕ Failed to get request token
        com.twitter.sdk.android.core.TwitterApiException: 401 Authorization Required
                at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:383)
                at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
                at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
                at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                at retrofit.Platform$Android$2$1.run(Platform.java:142)
                at java.lang.Thread.run(Thread.java:818)
    09-25 16:30:09.521  29572-29572/PACKAGE E/Twitter﹕ Authorization completed with an error
        com.twitter.sdk.android.core.TwitterAuthException: Failed to get request token
                at com.twitter.sdk.android.core.identity.OAuthController$1.failure(OAuthController.java:95)
                at com.twitter.sdk.android.core.internal.oauth.OAuth1aService$1.failure(OAuth1aService.java:215)
                at com.twitter.sdk.android.core.Callback.failure(Callback.java:45)
                at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
                at android.os.Handler.handleCallback(Handler.java:739)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5430)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)
    
[/code]


CC BY-SA 3.0
2015-09-25T09:33:24.197
16926
2015-10-09T02:13:08.220
2015-09-25T13:50:13.983
5337
3457
question
android twitter oauth
AndroidのTwitter SDKでログイン認証できない


dev.twitter.comでアプリタイプはブラウザにしてください。

ソース：  
<https://twittercommunity.com/t/set-application-type-to-browser/235>  
<https://groups.google.com/forum/#!topic/twitter-development-talk/D3RP6D_Z75A>


CC BY-SA 3.0
2015-10-09T02:13:08.220
17451
2015-10-09T02:13:08.220
2437
16926
answer