我已經建立了一個API,我通過Retrofit進行調用。 我是新的改造,但我相信我得到了一個響應,但是當它觸發onFailure()時我得到一個堆棧跟蹤。Android - Retrofit:獲取響應時出錯。 Gson錯誤
我正在使用MainActivity.class中的API。
這是什麼意思,我該如何解決。
堆棧跟蹤: http://pastebin.com/ADXhxsFP
搖籃:
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp3:okhttp:3.0.1'
compile 'com.google.code.gson:gson:2.5'
你的JSON創造新的有錯誤的語法,這是問題。你可以發佈你從服務器獲得的JSON響應嗎? –
{「Response」:「4611686018439042298」,「ErrorCode」:1,「ThrottleSeconds」:0,「ErrorStatus」:「Success」,「Message」:「Ok」,「MessageData」:{}} – Axiom
JSON是有效,所以我猜你是錯誤的POJO類轉換JSON。 –