I even cross checked the length of JSON array using a notifier, it’s giving correct value which is 56. Moreover, All the functions of app is properly working if I ignore this error.
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.
[ I have tried other ways also, but can’t figure out the exact block causing this error ( Suspecting that the JSONTools1.OpenJSONArray is the root cause of error but without this app can’t run ) ]
BTW, I have tried a lot things :
I even deleted / Disabled the whole for loop but even got the error therefore I suspect problem is with OpenJSONArray.
If so then there can be:
1.Problem in some other blocks
2.You have not parsed JSON correctly
Runtime Error says a lot about error in code either in java or blocks.And this runtime error shows that the problem is because a JSON array has 0 as length.So either JSON is empty or has empty array.