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

前端 未结 2 1114
名媛妹妹
名媛妹妹 2020-12-17 05:45

Have been trying on these codes and I want to send a email which will auto generate the password and the random password will then update in my database column which is the

相关标签:
2条回答
  • 2020-12-17 06:21

    I had the exact same problem - the string had a table like this generated before my actual JSON object. I put this table into a HTML file and displayed it - turns out it's a call stack for PHP functions:enter image description here

    I fixed the deprecated warnings by adding the following line in the php file:

    error_reporting(E_ALL ^ E_DEPRECATED);
    

    This fixed the reply string and I was now able to parse it successfully.

    0 讨论(0)
  • 2020-12-17 06:47

    As the error message says:

    [..snip..] json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
                                         ^^^
    

    The JSON string you're trying to parse is invalid - looks like it's got some raw HTML, which mean it's either badly generated, or PHP is inserting errors/warnings and destroying the string.

    0 讨论(0)
提交回复
热议问题