Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject [closed]

会有一股神秘感。 提交于 2019-11-29 00:47:54

I solved the question myself.

In backend PHP file, I used echo statements, which also outputted as response. So, the json String contained a html tags and/or lines and so, it couldn't be parsed.

Remove all echo statements or relative statements in your backend file. It will work. Thanks.

You json String contains a <br /> tag so it can't be parsed.

Try you url in a browser and check that the result is pure json.

Convert the string to json object in post execute method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!