Maximum number of strings is 255?

Hi, just checking that the maximum number of strings allowed across all strings resource files is 255? I can't find any info or posts about this and wondering if I've missed a way around the compiler limit error that is shown.
  • How are you seeing this? Is there an error message that happens when you compile? Is it only with some target devices? 255 is a whole bunch of strings, but if they use a byte to ID one, would make sense.
  • Hi Jim, this is what appears in the Eclipse console when compiling (for the Fenix 5X plus and a couple other devices I tried):



    BUILD: C:\Program Files\Java\jre1.8.0_201\bin\java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar C:\Garmin\dev\connectiq-sdk\connectiq-sdk-win-3.0.8-2019-1-23-8f00e4f\bin\monkeybrains.jar -o C:\Garmin\dev\projects\test1\bin\test1.prg -w -y C:\Garmin\dev\developer_key.der -f C:\Garmin\dev\projects\test1\monkey.jungle

    BUILD: ERROR: ERROR: assembler: Compiler limit exceeded while assembling globals_Rez_Strings; 255 fields allowed, 256 found

    BUILD: Complete



    And yep it makes sense for a 1 byte id! I'm using 64 for colors … so maybe I'll change that in future watchfaces if it really is the limit :-)
  • As it says 255 in the error, I'd consider that the hard limit. Maybe it should be noted some place like the Programmer's guide, but it seems to be uncommon to have that number of stings. This is the first I've heard someone run into it.
  • Former Member
    Former Member
    I've created a ticket for a feature request to up the String limit on devices with memory to support it.
  • Awesome, thanks Coleman! More strings would potentially allow more features while still keeping a nice user experience when changing settings. For now, I really must … stop … adding … features! :-)
  • Well, the fix *may* come at a cost. Be careful what you wish for.
  • I hope that cost isn’t increased memory usage for existing apps, especially those that load resources at run-time.... (If you load one or more resources at run-time, the entire resource index gets loaded into memory, which increases the impact of strings on runtime memory)