UTF-8的BOM头导致 在使用  JSONObject jsonContent = new JSONObject(content);直接转到异常处理

查看log发现

 org.json.JSONException: Value  of type java.lang.String cannot be converted to JSONObject。

因为用另外的一个文件没有出错,查到JSON文件,发现多了UTF-8的BOM文件头

尝试去掉JSON数据文件的BOM头,问题解决。

相关文章:

  • 2021-07-24
  • 2022-12-23
  • 2022-02-09
  • 2021-10-11
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
猜你喜欢
  • 2021-06-25
  • 2022-12-23
  • 2021-07-15
  • 2021-12-01
  • 2022-12-23
相关资源
相似解决方案