Crash only on first start: File no found / Failed invoking

Hi there,

I am encountering a strange problem that I'm not able to solve after hours of tinkering around:

I have a watchface that, when installed immediately shows a CIQ error screen. When I go to the watchface selection on the device it works just fine from then on.

The CIQ_LOG.YML shows:

Error: File Not Found Error
Details: 'Failed invoking <symbol>'
Time: 2022-04-07T13:50:06Z
Part-Number: 006-B3943-00
Firmware-Version: '8.13'
Language-Code: deu
ConnectIQ-Version: 4.1.1

No stack, nothing.

My watchface has a background process and a lot of settings. The onSettingsChanged method sets some values with Storage.setValue() to make them available to the background.

Interestingly, everything almost works fine when I run it in the simulator, only that if I didnt run it for a while, the debug will say "Encountered app crash" without further message - when that happens, the simulator is still running normally and I can continue triggering background processes or whatsoever.

It almos seems like a race condition where the background process is calling onBackground when the app is not yet ready for it... Here's what the simulator outputs:

***INITIALIZE***
***STARTUP***
***STARTUP FINISHED***
getInitialView
****background registered****
Lastlocupdate is null
Restored solar info failed - recomputing...
Background: onReceive... 
Background: Response: 401

Encountered app crash.

Here's some of the code:

function initialize() {
        System.println("***INITIALIZE***");
        AppBase.initialize();
        
    }

    // onStart() is called on application start up
    function onStart(state as Dictionary?) as Void {
    System.println("***STARTUP***");
    
    System.println("***STARTUP FINISHED***");
    }

    // onStop() is called when your application is exiting
    function onStop(state as Dictionary?) as Void {
    }

    // Return the initial view of your application here
    function getInitialView() as Array<Views or InputDelegates>? {
        System.println("getInitialView");
        $.gDeviceSettings = System.getDeviceSettings();
        if(inBackground == false){
            // getAllSettings();
            //register for temporal events if they are supported
            if(Toybox.System has :ServiceDelegate) {
                canDoBG=true;
                Background.registerForTemporalEvent(new Time.Duration(10 * 60));
                System.println("****background registered****");
            } else {
                System.println("****background not available on this device****");
            }
        }
        return [ new TAWATXView() ] as Array<Views or InputDelegates>;
    }

I'd appreciate any hints! I have tried sideloading but it is the same behaviour - also my ERA viewer won't start after I input my information... It say collecting data and then crashes...

Thank you so much!