如何解决我从from android仿真器获得的错误

com.google.gson.stream.MalformedJsonException:使用JsonReader.setLenient(真)接受第1列路径$中格式错误的JSON
private void registerToken(final String token) {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(Constants.BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
tokenPostAPI = retrofit.create(TokenPostAPI.class);
Call<String> tokenPostCall = tokenPostAPI.request(token);
studentPostCall.enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Log.e("token", "onFailure: "+t.toString() );
Log.e("token", "onFailure: applied token "+token);
}
});
}下面是应用的令牌=
"fQEG8hgG8oE:APA91bGKsH78Ft6wCDW2EtMsuC19EXl10pxkJ95ZrVwnmaofFcw8-TgxeASujQva_gM7gYijIduYL82TmR5qeExxaeHP_252ZOSx7in99ShnaKwE8bsnOyYBDAI4M34d3APCiJKpWDqC "符号总数152个。
发布于 2016-11-10 05:58:11
'com.google.code.gson:gson:2.6.1'编译
Gson gson = new GsonBuilder()
.setLenient() //building as lenient mode`enter code here`
.create();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create(gson))
.build();https://stackoverflow.com/questions/40520719
复制相似问题