What causes this anonymous error?

Hi,

Debugging something for a friend and I keep seeing this on start up:

Encountered an app crash.

No stack trace, and the project still runs in simulator.

I'm digging through with .println at the moment to find where it happens, but I was wondering whether anybody had an idea of a good start point to look? The links I found were relating to things that aren't in play at the time the line is output.

G

  • I'm seeing this too, and while it happens most times with one the app I'm working on, but most times.

    It's when I first do a run, never after something has been running for a bit.  I suspect it's something with starting the app running in the sim, and with it not being 100% consistent, I'm thinking it may be something with timing and  possibly involving these in the 0.1.4 changelog:

    • Show output from stderr when launching the simulator
    • Wait for simulator to launch before attempting to run an app
  • It doesn't seem to happen so much in Eclipse, so not sure whether VSCode does anything differently there.

  • Thanks for the report. We'll take a look at this.

  • Former Member
    Former Member

    I'm seeing this too - it occurs for me after I simulate a temporal background event in the simulator on a watchface. My background event is currently very barebones, literally just passing one boolean on `exit()` and then using `System.println()` to print that value in the `onBackgroundData()` call when the watchface process runs again.

    Running macOS 10.15.7, CIQ 3.2.3.

  • Former Member
    Former Member in reply to Former Member

    After more testing using an example Garmin app, I can confirm that this issue only occurs for me on CIQ SDK versions above 3.1.9. 

    Once I switched back to 3.1.9 and recompiled/reinstalled the same code, it worked without producing this strange error. 

    Furthermore, replacing the 3.2.3 ConnectIQ simulator within the SDK folder with the old 3.1.9 simulator is the perfect workaround - I can build with the latest version of CIQ but run with a simulator that doesn't crash. God bless not having to use Eclipse. 

  • Thanks for the suggestion. Sadly this doesn't seem to work for me. Did you just copy the old SImulator.exe or also other files?

  • Former Member
    Former Member in reply to Roboleo1010

    I'm not sure about Windows, sorry. I'm on macOS Cantina Band (10.15.7). 

    All I did was open the 3.2.3 SDK folder, delete the simulator file there, then copy the 3.1.9 simulator file into that folder. Seemed to work for me.

  • Thanks for your quick reply!

    This doesn't work on Windows, but I found another Workaround:

    Install SDK 3.2.3 (Use as SDK) and SDK 3.1.9. 

    To start your app using the old Simulator do the following:

    Open a command line and navigate to the 3.1.9 SDK bin folder (Appdata/Roaming/Garmin/connectiq-sdk-win-3.1.9-2020-06-24-1cc9d3a70/bin).

    Open the old simulator (3.1.9) (also in the above specified folder)

    Type the following in your command line: monkeydo "PATH" "DEVICE"

    PATH: Path to your compiled .prg file

    DEVICE: your devcename as spelled in your manifest.json eg. "venu"

    You can now trigger Background Events without getting the "Encountered an app crash." error!!

    All System.print calls are displayed in the command line where you started monkeydo.

  • Make sure you don't have the background permission set for an app that doesn't have a background service annootated with :background.

    Do not give an app the background permission unless it needed it.

  • I also created a tasks.json file. To Start the simulation and bind the app just press ctrl + shift + b.

    {
    	"version": "2.0.0",
    	"tasks": [
    		{
    			"label": "Simulate",
    			"dependsOn": [
    				"Start Simulator",
    				"Bind PRG"
    			],
    			"group": {
    				"kind": "build",
    				"isDefault": true
    			}
    		},
    		{
    			"type": "shell",
    			"label": "Start Simulator",
    			"command": "C:\\Users\\[username]\\AppData\\Roaming\\Garmin\\ConnectIQ\\Sdks\\connectiq-sdk-win-3.1.9-2020-06-24-1cc9d3a70\\bin\\simulator.exe",
    			"isBackground": true
    		},
    		{
    			"type": "shell",
    			"label": "Bind PRG",
    			"command": "\"C:\\Users\\[username]\\AppData\\Roaming\\Garmin\\ConnectIQ\\Sdks\\connectiq-sdk-win-3.1.9-2020-06-24-1cc9d3a70\\bin\\monkeydo\" \"[path to app bin folder].prg\" \"venu\"",
    			"isBackground": true
    		}
    	]
    }

    Don't forget to replace username and your project directory.