当前位置:网站首页>物联网平台返回数据解析时遇到org.json.JSONException: No value for Value怎么办
物联网平台返回数据解析时遇到org.json.JSONException: No value for Value怎么办
2022-07-24 21:58:00 【TMS320VC5257H】
使用android studio编写APP解析来自阿里云物联网平台返回的信息。

有时会遇到org.json.JSONException: No value for Value的错误信息
这个信息从哪里看呢?
是从android studio的logcat窗口观察,调试的时候在这个窗口会有提示。

解决方法是:到物联网平台查看所需调试的设备,物模型是否都有数据。如果没有数据,那么让设备上线,然后发送一个属性数据。或者用设备模拟器上报一个数据。再运行一下android studio,就可以发现问题消除了。

造成这个问题的原因是返回数据为空。
如果您的设备定义了很多个属性,而解析的时候,对每个属性进行解析,那么碰到有一个属性没有值,就会报空,而认为它是错误的。
所以这时候可能会报 org.json.JSONException: No value for XX异常。
边栏推荐
猜你喜欢
随机推荐
窗口内最大值或最小值的更新结构——窗口内最大值
Cell专刊|AI在蛋白结构、精准医疗、抗体疗法[综述]等的应用与未来预测
[database learning] redis parser & single thread & Model
Which is the best interface documentation tool at home and abroad?
Gradle learning - gradle advanced instructions
Web3安全 Go+Security
Monotonic stack structure
What do GB, MB and KB mean respectively. What are the sizes
做好项目管理的10个关键点和5大措施
Pyqt5 uses qfile and qdatastream to read and write binary files
[postgraduate entrance examination English vocabulary training camp] day 11 - offer, form, maintain, critical
Oracle中实现对指定数据分组且获取重复次数
[Apipost和Apifox哪个更好用?看这篇就够了!]
PCL点云处理之找到直线点集的两个端点(五十七)
有序表之AVL树
ACL 2022 | comparative learning based on optimal transmission to achieve interpretable semantic text similarity
Go+ language
From A76 to A78 -- learning arm microarchitecture in change
[postgraduate entrance examination vocabulary training camp] day 12 - native, separate, figure, contribution, categories, assessment, propose
How to adjust the default output of vscode to the debugging console to the terminal and the problem of garbled code in both



![[database learning] redis parser & single thread & Model](/img/70/c84eb02d45e35fede4dd1b1ff04392.png)




![洛谷 P2024 [NOI2001] 食物链](/img/7f/6ccbc19942f0d4a153025346496834.png)
