Looking for help on an odd resource error

Former Member
Former Member
At least, I think it is a resource error...

Hi Connectors,

I am in a bit of a bind here. I recently did some refactoring of my code to try to save some KBs and was left with a peculiar error:

Failed invoking <symbol>
Unexpected Type Error
in findDrawableById (d:\1_2_1\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\WatchUi.mb:554)
in onUpdate (C:\Users\Jeff\_my_garmin_workspace\GarminApps\CleanWatchFace\source\MyGridView.mc:125)
Unexpected Type Error

Here is the offending code:
[125] var dTime = View.findDrawableById("TimeLabel");

"TimeLabel" is still clearly defined in my rez code (in layouts/layout.xml, to be exact). Now, this error unto itself wouldn't be a surprise since I had been reformatting my *View.mc code.

The rub is that after doing a 'git reset --hard <sha>' to a previous commit that I know was working (wouldn't have committed otherwise) I am still seeing this error. Anyone have insight into what could have gone wrong here?

Thanks,
Jeff
  • There have been problems with the plugin where it continues to use a version of the .prg that should have been replaced. You can often fix this by exiting the simulator, deleting the offending files (on windows systems delete the %TEMP%\Garmin folder), and then building the program again.

    If the error message is accurate, it would seem that you have something that isn't a drawable in the layout. Is that possible?
  • Former Member
    Former Member over 9 years ago
    Hi Travis,

    No I dont think that is possible. Like I said, I reverted to an earlier commit that I had validated as working and the error was persistent across that revert.

    Your description sounds consistent with the type of monkeying around I was doing within my project. I'll give your solution a go and let you know the outcome.

    Thanks,
    Jeff
  • Former Member
    Former Member over 9 years ago
    ....and it worked!!
    Thanks! Boy howdy these forums have been helpful. I am going to start a document that captures this sort of "tribal knowledge" and share it when it reaches several helpful hints.
  • ....and it worked!!
    Thanks! Boy howdy these forums have been helpful. I am going to start a document that captures this sort of "tribal knowledge" and share it when it reaches several helpful hints.


    There is a "New Developer FAQ" sticky at the top of the forum, and it might be best to contact Brandon, and have him add stuff to that that you find. Most of what you're looking for is probably in the forums someplace, and Brandon started that thread a month or so back to organize this type of stuff.
  • I've got a short list of items I'd like to document at some point soon. Ultimately, I'd like to put together some kind of 'best practices' section of the Programmer's Guide or something along those lines. I'm also auditing the samples for consistency and code style to help set a better example with our own apps (some of them were written over a year ago and could use some updating). Please feel free to forward along any FAQ or best practices ideas!