My app is crashing on Background.exit() in SDK 4.0.7 and 4.0.8. SDK 4.0.6 is ok.
Has anyone come across this problem ?
My app is crashing on Background.exit() in SDK 4.0.7 and 4.0.8. SDK 4.0.6 is ok.
Has anyone come across this problem ?
What is the crash you are seeing?
What target device do you see it on? Do you see it on everything?
I'm seeing this on Fenix 5,6,7, and Epix in the Simulator.
The Debug console doesn't provide anything useful just
WebRequest: https://www.XXXXXXXXX
Background: onReceive: true : {XXXXXXXXXX}
Background: Returning background data
Encountered app crash.
The code snippit is:-
function onReceive(responseCode, data) {
if (responseCode == 200) {
System.println("onReceive: " + inBackground + " : " + data);
if(inBackground==true) {
System.println("Returning background data");
Background.exit(data);
}
else {
is onBackgroundData called? Is "data" json data that's been converted to a dictionary?
onBackgroundData is never called. The "data" variable contains JSON data returned from a web request but I don't think it has anything to do with the data values as the app still crashes if I replace "data" with null or even {}. eg: Background.exit(null);
What are you seeing for memory usage in the background? Is your background code annotated with :background? Otherwise it will try to load the whole prg when the background runs.
Yes background code is annotated. Everything works fine in SDK 4.0.6 but not in the newer SDK's
Can't see memory usage as the simulator crashes on the Mac whenever I try to view memory
System.getSystemStats().availableMemory.
Do some println calls in your background service.
I also encountered the same problem with a WF that queries OpenWeatherMap. It works fine on my VA3, but the simulator (Win 10, 4.07 & 4.08) crashes at the same place. The WF display continues to run but VSCode debugger is disconnected. I went back and got no crash in 4.06.
Same with you vsbgwf.zip example that you posted a while back.
Here is the printout I get from my app
Simulator Win 10 4.08 & 4.07:
Background: onTemporalEvent: 11:42
Background: onReceiveOWMCurrent: 11:42=200
Encountered app crash.
Simulator Win 10 4.06 (or VA3 debug log) -- runs fine:
Background: onTemporalEvent: 12:05
Background: onReceiveOWMCurrent: 12:05=200
onBackgroundData:{wspd=>1.540000, feel=>-25.080000, id=>803, desc=>nuageux, wgst=>null, cod=>200, temp=>-20.360001, wdir=>40, clds=>76, icon=>04d, err=>200, hhmm=>12:05}
Try triggering it with the Simulation|Background Event menu from the simulator, instead of waiting for the periodic event.
If you are doing the run with "Start Debugging" try "Run without Debugging" or v/v. The comment about the debugger getting disconnected is interesting.
If you still have Eclipse, try that. I recall having an issue with a background service and vs code a while back.
Does it happen in vs code and the 4.1.0-beta1 SDK?