Acknowledged

Analog Sample Broken

Hello,

I am a bit new to the Garmin IQ, but I am having trouble building the Analog watch sample. This is happening in both Windows 10 and Linux (Debian -- On a sidenote, if anyone is looking to get the SDK running on linux, I found a wonderful hint. Putting the *.so dependencies in the folder of the sdk installer worked for me).

I have tried 4 different SDK samples  (SDK 4.2, 4.1.7, 4.1.6 and 3.1.8). The most recent 2 have a second issue as well, but it is easily fixed. 

Here is the error I am getting, and because I am so new to Monkey C, I am having difficulty figuring out which asset is missing.

Error: Symbol Not Found Error
Details: Failed invoking <symbol>
Stack:
- onLayout() at ~\samples\Analog\source\AnalogView.mc:59 0x10000955

Encountered app crash.

This is the code block AnalogView.mc where it crashes.

// If this device supports BufferedBitmap, allocate the buffers we use for drawing
        if(Toybox.Graphics has :BufferedBitmap) {
            // Allocate a full screen size buffer with a palette of only 4 colors to draw
            // the background image of the watchface.  This is used to facilitate blanking
            // the second hand during partial updates of the display
            offscreenBuffer = new Graphics.BufferedBitmap({
                :width=>dc.getWidth(),
                :height=>dc.getHeight(),
                :palette=> [
                    Graphics.COLOR_DK_GRAY,
                    Graphics.COLOR_LT_GRAY,
                    Graphics.COLOR_BLACK,
                    Graphics.COLOR_WHITE
                ]
            });
The other issue with the newer samples is the following.
When using VSCode to set the products, I get the following error...
 
Command 'Monkey C: Set Products by Product Category' resulted in an error (Cannot read property 'each' of undefined)
I have tried building for the Venu, The Fenix 7, and the Fenix 6.
Oddly enough, If I try to build with the manifest as is, I get the following error...
ERROR: fenix6: Invalid device id found in the application manifest: 'descentmk1'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fenix3'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fenix5'.
ERROR: fenix6: Invalid device id found in the application manifest: 'd2bravo'.
ERROR: fenix6: Invalid device id found in the application manifest: 'd2charlie'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fenix5s'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fr735xt'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fr230'.
ERROR: fenix6: Invalid device id found in the application manifest: 'epix'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fenix5x'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fr630'.
ERROR: fenix6: Invalid device id found in the application manifest: 'approachs60'.
ERROR: fenix6: Invalid device id found in the application manifest: 'd2bravo_titanium'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fr235'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fr920xt'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fenix3_hr'.
ERROR: fenix6: Invalid device id found in the application manifest: 'fr935'.
ERROR: Invalid device id found.
Of course, this issue is easily fixed by manually editing the manifest.
I do not have my watch yet (it comes tomorrow), so the error above is only on the simulator.
  • Yes, the sample isn't set to on with CIQ 4.x devices with the graphics pool.  When I was trying it, it was with pre 4.x devices (like the fr935).

    You need to use createBufferBitmap on 4.x target.  See https://forums.garmin.com/developer/connect-iq/b/news-announcements/posts/a-whole-new-world-of-graphics-with-connect-iq-4 for this and other differences. 

  • With 4.1.6, 4.1.7, and 4.2.0 beta one, the compiler has type checking on by default. The sample (from the 4.1.7 SDK) compiles fine for me with the 4.1.7 SDK

  • I got it to build. The issue may be that the offscreen buffer could be depreciated (I have not looked too deeply yet).

    So, commenting out the following lines made the sample build.

     // If this device supports BufferedBitmap, allocate the buffers we use for drawing
            if (Graphics has :BufferedBitmap) {
                // Allocate a full screen size buffer with a palette of only 4 colors to draw
                // the background image of the watchface.  This is used to facilitate blanking
                // the second hand during partial updates of the display
                _offscreenBuffer = new Graphics.BufferedBitmap({
                    :width=>dc.getWidth(),
                    :height=>dc.getHeight(),
                    :palette=> [
                        Graphics.COLOR_DK_GRAY,
                        Graphics.COLOR_LT_GRAY,
                        Graphics.COLOR_BLACK,
                        Graphics.COLOR_WHITE
                    ] as Array<ColorValue>
                });
    
                // Allocate a buffer tall enough to draw the date into the full width of the
                // screen. This buffer is also used for blanking the second hand. This full
                // color buffer is needed because anti-aliased fonts cannot be drawn into
                // a buffer with a reduced color palette
                _dateBuffer = new Graphics.BufferedBitmap({
                    :width=>dc.getWidth(),
                    :height=>Graphics.getFontHeight(Graphics.FONT_MEDIUM)
                });
            } else {
                _offscreenBuffer = null;
            }

  • Sorry, I forgot to add this. If anyone can point me to an analog sample that does work, that would be incredible. Thank you all for the software. I am excited to learn Monkey C.