Complications.updateComplication() crashes

I'm seeing crash reports where calls to Complications.updateComplication either causes and exception or crashes with "Symbol Not Found Error".

My app calls this only for devices that support complications and it works on my devices and the sim.

I can't figure out why this is happening quite a bit in the wild. 

I assume that the CIQ store wouldn't allow the app to be installed on a devices that don't have the API level that supports complications.  Is that a correct assumption?

  • In my defense, I did use the word phrase "all the complications code is excluded" :) 

    As you say "device+firmware combination that's important when it comes to new features.", this is precisely the reason I assumed that the store would not allow an app built with an SDK that introduces new features to be in stalled on incompatible FW.  I often come across an app where in the store it says "you need the latest FW to install".  That is why I made that assumption and I think it is a valid one.  I know in other system there is both a min SDK and built with SDK attribute associated with an app precisely to deal with such an issue.

    Anyway, I will do as you mention above, add has checks and exception handling to deal with this.  Personally, feels like an SDK/CIQ Store bug.

  • This is the message the user should be seeing when an app is built with an sdk that supports new features that is not compatible with the FW on their device:

  • Actually, not really.  In the compiler.json for a device, there is something like this:

                "firmwareVersion": 1571,

    And that gets included in the manifest.xml for the iq file you build, like this:

    minFirmwareVersion="1571"

    if the user is running FW older that 15.71, the user sees that message, and a number of things can be involved, including they just haven't updated their firmware in a while.  It's not only based on what is and what isn't available.  A user could see that on a device that doesn't support complications.

    To be safe, you probably want to do a "has" check.  Kind of like this:


            hasComplications=(Toybox has :Complications); 
            if(hasComplications) {
                hrId=new Id(Complications.COMPLICATION_TYPE_HEART_RATE);
                if(hrId!=null) {
                    hrComp = Complications.getComplication(hrId);
                    Complications.registerComplicationChangeCallback(self.method(:onComplicationChanged));
                    Complications.subscribeToUpdates(hrId);    
                }
            }

    This isn't a bug in the store/sdk/firmware

    Unless you take steps to avoid doing things on FW that doesn't support it, it's your bug.  That's why "has" exists.

  • The docs say these devices support Complications so the FW check should be used by the store and we should not need to use 'has' which is for devices that don't support a feature.

  • If the user gets that message they clearly can't install your app, and you probably want to check the manifest.xml in the IQ file you sent to the app store to see what firmware it thinks is the minimum.

    For example, if you've not updated your device files in a while, it could have a FW version that doesn't support complications in the IQ file, so it will install on devices without the needed FW..

  • But what do you see in the iq file's manifest.xml?

    Include the "has" check if you want to be as safe as you can.

  • look at the firmware version I pointed out.  where you see 1571.

    If I look at the epix2's compiler.json, it also has this for CIQ version:

    "connectIQVersion": "4.2.4",

    and in an iq file's manifest.xml, also see

    connectIqVersion="4.2.4"

    Looks to me you don't have the current devices files, or you'd also see 4.2.4 in these two places.

    Don't confuse this with what you have in the manifest.xml for your project.  Two different things...

  • Just so you understand, this is as example of part of what you should see in the manifest.xml in the iq file

                <iq:product connectIqVersion="3.4.2" filename="006-B3652-00/WuWid2.prg" id="fr945lte" minFirmwareVersion="1519" partNumber="006-B3652-00" settings="006-B3652-00/006-B3652-00-settings.json" sig="7D8B92CFE3431695EF81F295E63B949D1F58B679E1C8DD40239891656004192ADD416F3B5C9E607163427B270554D29802B52A4F2C3214E7FE6C35BE0BC22E39CF15CBFEC5BA79E3C20E24C3382BB960948F70227375C1654A97F74833456EA0DBD5112ECA7D8AB777B3BF31AE2E6FE3E02493DB9E0D9F469E7F06F603645384EF8CCC75E99B0AFE7CEAB00F34D4E02CD30D1D4C99F7BC3BC64C1409DE2281E8DD52F1BABBC433EF75ECE4126D929F7CD822F71471F832FE74834AACCEE074C44103D7D088E944ADA14423CE890BEC19294C621C3ED0323A628883BBA30F668CA5043CD5B7790CBD35086B6A9161EA6AD387B349C8C6F4C02353C9476DE29CFB44476687E08C26444DE2C16B4F4595324A8B715FC4816C4FF0A852CED4A8D5B68621D813BB527568009E8A3EE2F0AA8A00A2AAADDBD28C8722157C78B50CF45E19B23681A8AD3490E17C723D618A7C0D15CEA747A2E7BE55D875ABC35FF1DA43705376E0BFA574B2BF74BFFE84674C5FB996EF1F6ECB7A314087219C7C38936A5CE76A91F1C4E25184D1DD5416F94E7C8F4E6BC366CC06EE8E78E009FDADFA5A9607078998A7C3BD78C1C21809E9A94F5049DAB29AF7DEFFCAA48E10FBCFD27FFA9A0170AAB2C38B249AA1C5F2C764453E0B79E64F179268D6159C7E9F5ADDE362201090D3596A8E85AA89A7A079259C2CD54C4C242B5DD7C1F49EB1EA93BADA" sigFormat="rsa-4096"/>
                            
                <iq:product complications="006-B3944-00/006-B3944-00-complications.json" connectIqVersion="4.2.4" filename="006-B3944-00/WuWid2.prg" id="epix2" minFirmwareVersion="1571" partNumber="006-B3944-00" settings="006-B3944-00/006-B3944-00-settings.json" sig="247C921954DE50A292AC76E769C35CCD321D4A90E396D127FAB5CFB83AF787D09B2C4F34D84D5ED603EF0E9B1B22A0D08350DC22EC50459CC78A916B04CA1E17A433D48C1A89570DD55AA7DAB1B69F2192DC2281DAF8C1F096797D312AAFFA7B03B39F6CD3E7A14BC0AC57D653C76FDCF8DCF171F7E695F339E23238FBA3BA132C8651D4E9A176E9D5562C1D0184C726FCB4B1C3B25C9E60A30123924C5686FABAA9F6AAA832228586582D6AC0D5B26C01FD631C64BD30AAA0D57EA95C11F1365803C2349EAE84CC4D0F1BB8B2CDD51E08E8E7D0F89EB62ED2EADCE72D066376318EC1229F0BD63E630A780EAF577F71CA55C5809FF59CCD1392E41E370EC6A2EE55FC4C23B5DAC3DB495E52C1121E294336C7D284D3C4CEC6928F491F301EBD1223140EED079C8673B4E97704B71F4F220F07E36981CB33A1D4E9D5B5849687950D9894733474326EAC91A99A9CEF9310E9B25C9DC70D2AD4D9E1241F65B6FA2E3C57634419367BBA7EADD53F3345D9115200795793870983D859EDA9CB79EC10D5273D7B4E27D11E1ADF811152CDFF300561838198A592A6BF332BE469BC28DFF1F1D1801236BD966E1C3DB6B5501D33F3841244B15C782AE0950587A7B5D8A9706752B9160524C0D02D26A499BDCCE8DAC707F89D5A98D0B866DE52C46CEF036DFDC3A7D29902A1B79F8BA89CFC3A8A650F49E3A46E865D1E7F28F9748C3D" sigFormat="rsa-4096"/>
                            
                <iq:product complications="006-B3943-00/006-B3943-00-complications.json" connectIqVersion="4.2.4" filename="006-B3943-00/WuWid2.prg" id="epix2" minFirmwareVersion="1571" partNumber="006-B3943-00" settings="006-B3943-00/006-B3943-00-settings.json" sig="247C921954DE50A292AC76E769C35CCD321D4A90E396D127FAB5CFB83AF787D09B2C4F34D84D5ED603EF0E9B1B22A0D08350DC22EC50459CC78A916B04CA1E17A433D48C1A89570DD55AA7DAB1B69F2192DC2281DAF8C1F096797D312AAFFA7B03B39F6CD3E7A14BC0AC57D653C76FDCF8DCF171F7E695F339E23238FBA3BA132C8651D4E9A176E9D5562C1D0184C726FCB4B1C3B25C9E60A30123924C5686FABAA9F6AAA832228586582D6AC0D5B26C01FD631C64BD30AAA0D57EA95C11F1365803C2349EAE84CC4D0F1BB8B2CDD51E08E8E7D0F89EB62ED2EADCE72D066376318EC1229F0BD63E630A780EAF577F71CA55C5809FF59CCD1392E41E370EC6A2EE55FC4C23B5DAC3DB495E52C1121E294336C7D284D3C4CEC6928F491F301EBD1223140EED079C8673B4E97704B71F4F220F07E36981CB33A1D4E9D5B5849687950D9894733474326EAC91A99A9CEF9310E9B25C9DC70D2AD4D9E1241F65B6FA2E3C57634419367BBA7EADD53F3345D9115200795793870983D859EDA9CB79EC10D5273D7B4E27D11E1ADF811152CDFF300561838198A592A6BF332BE469BC28DFF1F1D1801236BD966E1C3DB6B5501D33F3841244B15C782AE0950587A7B5D8A9706752B9160524C0D02D26A499BDCCE8DAC707F89D5A98D0B866DE52C46CEF036DFDC3A7D29902A1B79F8BA89CFC3A8A650F49E3A46E865D1E7F28F9748C3D" sigFormat="rsa-4096"/>
                            
                <iq:product complications="006-B4024-00/006-B4024-00-complications.json" connectIqVersion="4.2.4" filename="006-B4024-00/WuWid2.prg" id="fr955" minFirmwareVersion="1720" partNumber="006-B4024-00" settings="006-B4024-00/006-B4024-00-settings.json" sig="54A05C69956D15F29DD8B82EE3DCA81D6F9A6560CFAE481BFC33FDB50871A6789AB8ED53E10CEACD64178BD808BEB036BF948F3D55C6AA4657245878B631F2396D05A330CEFD2358CDF8C522C4DEF06AFFDB46C7CEF6A2A5B8131FD0166C018E056543DBE4CCB92008136BF82DE602ED9A2E42400173A1708F33EBDF9B5044110EF1870FCDBEDCDE206C18110F89CBAACA4FA8C15387354B498C7490A9CB982DCC5C1E583B6AB4668AB5F71170891D968206B8869F1BF20BF451E007E33A1B3D528697048012CDA5F42CD915AB612F9AE1E0EE77F54F7B9D2558CF8E628C3F898BBB99D6719CF0A013E10C348561E9764E065530897579596E35C7782A32E9211F11D060649190488344F8D94A1122C3D13967FC96B2E3DFF1DE0CAA5163954952E37EE721ACE97F6BF540436B454E0AF1F47CBD7F08E50BE6F7E480CF85015E4840AEFE9F0E7DC59F81E720ECEBA675F36518DB6372919AD4456D56F7C7E12211EC42E5F6142AB3E33E36663BE8FF285D6FF331B2B3CB09CA5E95E077E9E917D303948650210E2081EFA77AB38D433574425A5B15CB30BA9CDE5BC73FE2DC593948ED4B4A11C51EA062C57DBDA9A5EAC2B402ECCCA097C56BC60D88E4A091949BB4C671BADF35B4F8466B644CEB3F39C97B6C82B61B41335EDC96E435D7A3FBB2AE7CEEE86C34E3F3287502E8A986D9ABDF6E7420E96BFA3E8B375357D86EC0" sigFormat="rsa-4096"/>
                            
                <iq:product connectIqVersion="3.4.2" filename="006-B3251-00/WuWid2.prg" id="marqathlete" minFirmwareVersion="2589" partNumber="006-B3251-00" settings="006-B3251-00/006-B3251-00-settings.json" sig="7D8B92CFE3431695EF81F295E63B949D1F58B679E1C8DD40239891656004192ADD416F3B5C9E607163427B270554D29802B52A4F2C3214E7FE6C35BE0BC22E39CF15CBFEC5BA79E3C20E24C3382BB960948F70227375C1654A97F74833456EA0DBD5112ECA7D8AB777B3BF31AE2E6FE3E02493DB9E0D9F469E7F06F603645384EF8CCC75E99B0AFE7CEAB00F34D4E02CD30D1D4C99F7BC3BC64C1409DE2281E8DD52F1BABBC433EF75ECE4126D929F7CD822F71471F832FE74834AACCEE074C44103D7D088E944ADA14423CE890BEC19294C621C3ED0323A628883BBA30F668CA5043CD5B7790CBD35086B6A9161EA6AD387B349C8C6F4C02353C9476DE29CFB44476687E08C26444DE2C16B4F4595324A8B715FC4816C4FF0A852CED4A8D5B68621D813BB527568009E8A3EE2F0AA8A00A2AAADDBD28C8722157C78B50CF45E19B23681A8AD3490E17C723D618A7C0D15CEA747A2E7BE55D875ABC35FF1DA43705376E0BFA574B2BF74BFFE84674C5FB996EF1F6ECB7A314087219C7C38936A5CE76A91F1C4E25184D1DD5416F94E7C8F4E6BC366CC06EE8E78E009FDADFA5A9607078998A7C3BD78C1C21809E9A94F5049DAB29AF7DEFFCAA48E10FBCFD27FFA9A0170AAB2C38B249AA1C5F2C764453E0B79E64F179268D6159C7E9F5ADDE362201090D3596A8E85AA89A7A079259C2CD54C4C242B5DD7C1F49EB1EA93BADA" sigFormat="rsa-4096"/>
                            
                <iq:product connectIqVersion="3.4.1" filename="006-B3451-00/WuWid2.prg" id="marqathlete" minFirmwareVersion="2510" partNumber="006-B3451-00" settings="006-B3451-00/006-B3451-00-settings.json" sig="7D8B92CFE3431695EF81F295E63B949D1F58B679E1C8DD40239891656004192ADD416F3B5C9E607163427B270554D29802B52A4F2C3214E7FE6C35BE0BC22E39CF15CBFEC5BA79E3C20E24C3382BB960948F70227375C1654A97F74833456EA0DBD5112ECA7D8AB777B3BF31AE2E6FE3E02493DB9E0D9F469E7F06F603645384EF8CCC75E99B0AFE7CEAB00F34D4E02CD30D1D4C99F7BC3BC64C1409DE2281E8DD52F1BABBC433EF75ECE4126D929F7CD822F71471F832FE74834AACCEE074C44103D7D088E944ADA14423CE890BEC19294C621C3ED0323A628883BBA30F668CA5043CD5B7790CBD35086B6A9161EA6AD387B349C8C6F4C02353C9476DE29CFB44476687E08C26444DE2C16B4F4595324A8B715FC4816C4FF0A852CED4A8D5B68621D813BB527568009E8A3EE2F0AA8A00A2AAADDBD28C8722157C78B50CF45E19B23681A8AD3490E17C723D618A7C0D15CEA747A2E7BE55D875ABC35FF1DA43705376E0BFA574B2BF74BFFE84674C5FB996EF1F6ECB7A314087219C7C38936A5CE76A91F1C4E25184D1DD5416F94E7C8F4E6BC366CC06EE8E78E009FDADFA5A9607078998A7C3BD78C1C21809E9A94F5049DAB29AF7DEFFCAA48E10FBCFD27FFA9A0170AAB2C38B249AA1C5F2C764453E0B79E64F179268D6159C7E9F5ADDE362201090D3596A8E85AA89A7A079259C2CD54C4C242B5DD7C1F49EB1EA93BADA" sigFormat="rsa-4096"/>
                            
                <iq:product complications="006-B4115-00/006-B4115-00-complications.json" connectIqVersion="4.2.4" filename="006-B4115-00/WuWid2.prg" id="venusq2" minFirmwareVersion="259" partNumber="006-B4115-00" settings="006-B4115-00/006-B4115-00-settings.json" sig="11945A7E1EF77F40590C8CEBBAEA243996F1589F4D3422C2841043890506C0BE1375C9A6E99B248C302E8084AA37E1A8503685B11C539E866A8934321F6C439FF3E92979669E8B81D79FEED45E40134BFC721E63A9194EA78E318EC5297221819B9CB905DF8CAB4E7475D0EDBD8F9C4D0C48CC6667E03600E4CB80B0C23D9F3DD9C66B552D09A66B6807D499D3B5E0C994AEC7314CF451C6158B741A8800088C6D9EF76FA83D47934D5B046401A05597F4129C44E06287BC22E78040B834F0E61BE2D2726D1351C5A9D9DCACB874639508751926653BD22A1582B9E0A06B1701A03C40B2D69FF9D51D5033AAD4990CAFE00B20139C70E2CB2645814709156469E2A50F22AD8178008A6BBB99E3A48FEABE3094C4B750D6E9D1E0DDBB474E83B2C4FB437B7EEC09FB782C4C2F749D6A4820462B63A03ECF7E46A26DBE12EE2507B3A354EA6942DAD907B6A580DAAD34E8F73D465F44E668AAE205A30DD7136922FDFD5422254DA229BD39D2D838C01D2F42BF6EEC24EEEC621AB26CF4A88E3AA185163EEEB63D4A6DA371F3AA5C7A0C6D173E908C0B7A1F2D7E5BD0A25A223CFC2690F8973BDEB7FA52F2B7B3667792E079F2766C0B898C3341355649BA30050EFC011F7F59EB42BE5D27ADBB0D85A45CC8332894690A1F4542CEA5245892A7A7503CD7DA648DCBE97D61D1240DC37BBCEB594A7054F02608E8E1F6D81E237D0A" sigFormat="rsa-4096"/>