Hi, I have an app that, although works very well on my Fenix 7S Pro, on a simulated Instinct Crossover AMOLED, I get
Error: Out Of Memory Error
Details: Failed loading application
When I run it. What could be causing that?
Hi, I have an app that, although works very well on my Fenix 7S Pro, on a simulated Instinct Crossover AMOLED, I get
Error: Out Of Memory Error
Details: Failed loading application
When I run it. What could be causing that?
Ah man, do I feel STUPID lol. I did what you said and changed the field "memoryLimit" for type "watchApp" of device instinctcrossoveramoled and it still crashed. So I double checked…
Sorry, you're right. It's if you don't compile as a widget, older devices won't have Glance support. I turned that around lol.
I WAS COMPILING FOR THE OLD Instinct Crossover, NOT the AMOLED! LOL.
Ah that makes sense.
Tbh that was the first device I looked at when I read your post and obv it has far less memory than…
Are you sure it's an "app" like a watch-app? Or is it a datafield? Because look: https://github.com/flocsy/garmin-dev-tools/blob/main/csv/device2memory-datafield.csv
fenix7spro:262144
instinctcrossoveramoled:131072
Are you sure it's an "app" like a watch-app?
But he never said it was a watch app / device app. You are the one who assumed that. The question "are you sure...?" is an interesting choice, in that light.
I've harped on this before, but it's a typical issue with Garmin where they either use the same word to mean different things, or different words to mean the same things.
Even when it comes to communicating with end users about Connect IQ [*], Garmin will use "app" in 2 senses:
- app (1) = anything that can be installed from the Connect IQ app store. In the general sense, this meaning of app is basically "installable software that runs on a device", but it's not necessarily what a normie user thinks of as an app. (i.e. Most users would not think of a watchface or a data field as an app.)
- app (2) = the specific kind of app (1) that is not a watchface, data field, (classic) widget or music provider. This meaning of app is closer to the general public's conception of an app that runs on a computer, phone or tablet - a program that has its own distinct UI and pretty much takes over the device while you are using it.
[*] For example, the Connect IQ store is referred to as an "app store", but when you use the search filter in the CIQ app store (ios/android app), one of the categories is A / App. Since there are other categories (like watchface and data field), it's clear that app (2) is only 1 of several kinds of apps (1) that are available on the store.
Imo, Garmin's scheme of calling app (2) a "watch app" or "device app" does not do anything to clarify matters for those who don't already understand the terminology. After all, watchfaces, data fields and widgets also run on a watch / device.
The only reason *we* know what "watch app" and "device app" mean is because we are devs. If you told some normie user that they can download a "watch app" from the CIQ app store, the presence of the modifier "watch" would not really explain how a "watch app" is different than other types of apps in the app store.
It's compiled as a widget with background services.
Note that for CIQ 4.0 devices, any CIQ app (1) that has a type of "widget" in the manifest is actually compiled as device app / watch-app, since CIQ 4.0 devices no longer support CIQ widgets per se. (Device apps which wish to display a glance as if they were legacy widgets only need to implement getGlanceView()).
Since both of the devices in question are running CIQ 5 and/or started out with CIQ 4, in fact your widget is being compiled as a device app / watch app.
Hi, I have an app that, although works very well on my Fenix 7S Pro, on a simulated Instinct Crossover AMOLED, I get
Error: Out Of Memory Error
Details: Failed loading applicationWhen I run it. What could be causing that?
fenix7spro's memory limits:
watch-app: 786432
background: 65536
glance: 65536
instinctcrossoveramoled memory limits:
watch-app: 786432
background: 65536
glance: 65536
Hard to say without further investigation. Could be that there's additional memory overhead of the crossover for some reason. Is there anything in your app that's conditional on fenix7spro or instinctcrossoveramoled ?
Yeah, I know it's compiled as an app but if you want Glance support, you need to compile as a widget I believe. The app is compiled for over 90 different devices and all the recent devices that have the same memory restrictions aren't experiencing this problem. So it's either an issue with the simulator itself or something particular to that specific device.
Just for fun I built and run the jsondataresources SDK sample on both fenix7spro and instinctcrossoveramoled.
The memory usage stats were almost identical, although instinctcrossoveramoled's usage a *tiny* bit higher.
fenix7spro:
Memory Usage: 7.1/763.6 kB
Peak Memory: 8.6 kB
Object USage: 22/65535
instinctcrossoveramoled:
Memory Usage: 7.2/763.6 kB
Peak Memory: 8.6 kB
Object USage: 23/65535
Even if instinctcrossoveramoled uses 0.1 kB more memory than the fenix7spro in general, it seems unlikely that your app was close enough to the edge for this to make a difference.
To troubleshoot this, it might be helpful to see how much memory your app actually uses for instinctcrossoveramoled. Obviously you cannot determine that in the current situation, since the memory viewer is unavailable once your app crashes.
What you can do is manually edit ConnectIQ/Devices/instinctcrossoveramoled/compiler.json (make a backup copy first). Increase the memory limit for "watch-app" so that the app no longer crashes. Now you can compare the "resting" and peak memory usage for fenix7spro and instinctcrossoveramoled. I would guess that instinctcrossoveramoled's peak memory usage would be significantly higher than that of fenix7spro. Once you've confirmed that, you'll have to do some detective work to figure out why.
if you want Glance support, you need to compile as a widget I believe.
Incorrect, that is only true for CIQ 3 (and older devices). (Ofc devices which are very old - like CIQ 2 - do not support glances at all, but only fullscreen widgets).
If you export your app and open the resulting IQ file (it's just a ZIP), you will see that for all CIQ 4+ part numbers, the actual app type is "watch-app". It's no different than if you had specified "watch-app" in manifest.xml, *unless* you have any targeted devices/part numbers with CIQ < 4.
If you only deal with modern (CIQ 4+) devices, then the "widget" app type (in manifest.xml) is exactly the same as "watch-app".
In a nutshell, for CIQ 4+ devices, there is no such thing as a CIQ widget. All CIQ device apps support glances - a glance will be present if and only if getGlanceView() is implemented. (Note that this is different than widgets for CIQ 3 devices that support glances - in this case, if the app type is "widget" and getGlanceView() is not implemented, a default glance will be provided. This has actually caused problems for old widgets that are updated for CIQ 4/5 devices - they often lack a glance because the dev originally never implemented getGlanceView() but only relied on the default glance being provided. This is a huge problem for any widget that relies on "widget-like" functionality, especially the ability to be launched while an activity is in progress.)
Note that this also means that for CIQ 4+ devices, there is no such thing as a CIQ app which has a glance, but cannot be launched from the activity/app launcher. (To further underscore the point that there are no more CIQ widgets.) I think that's a shame because there are def native glances which are not present in the activity/app launcher, and I think it's a perfectly valid use case.
I'm not saying it's germane to your current issue, only wanted to clarify that since it's a common point of confusion and it's also something that Garmin does not explain. (In fact, they removed documentation which explained some of this stuff, because it's clear they only want to focus on new devices now, and not anything pre-CIQ 4.)
Ah man, do I feel STUPID lol. I did what you said and changed the field "memoryLimit" for type "watchApp" of device instinctcrossoveramoled and it still crashed. So I double checked what I was doing and... I WAS COMPILING FOR THE OLD Instinct Crossover, NOT the AMOLED! LOL. Oh well, the issue was 20" from the screen. Duh.
I WAS COMPILING FOR THE OLD Instinct Crossover, NOT the AMOLED! LOL.
Ah that makes sense.
Tbh that was the first device I looked at when I read your post and obv it has far less memory than fenix7spro. I think it's a very easy mistake to make.
Glad it's sorted!