Simulator error: "Cannot invoke method clear() on null object"?


(James Yong) #1

Without any change in code, suddenly the simulator is giving this error when trying to “update”. Problem persists when uninstalled and retrying. There is also no clear() function in the code.

Just wondering if anyone has seen this problem before with the simulator.

This is just one of the many instances where error messages with no end-user friendly information is presented. Which line number? Which function call? Stack trace?


(Toejough) #2

I’ve seen this before. I don’t know if it’s the same root cause as mine, but I found that I always get this error if you try to “unsubscribe()” when there are no existing subscriptions.

Do you have any unsubscribe calls? Try adding a dummy subscription before each of them and see if your error goes away.


(James Yong) #3

Thanks, yes currently installed and updated point to a common init function which does everything from enumerating unique devices, unsubscribe/unschedule, etc.

Maybe I should take unschedule and unsubscribe out and leave them only in the updated function.

Still, devs should fix this. Definitely not a “feature”. :stuck_out_tongue: