04-14-2024 12:10
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 12:10
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
hi, im having trouble with my widgets.gui code, my console looks like this: [2:07:56 PM] App: Error 22 Unknown element 'document' (resources/widgets.gui:1,1)
[2:07:56 PM] App: Error 22 Illegal top-level element (resources/widgets.gui:1,1)
[2:07:56 PM] App: Error 22 Unknown element 'button' (resources/widgets.gui:2,1)
[2:07:56 PM] App: Error 22 Unknown attribute 'id' (resources/widgets.gui:2,1)
[2:07:56 PM] App: Error 22 Unknown attribute 'width' (resources/widgets.gui:2,1)
[2:07:56 PM] App: Error 22 Unknown attribute 'text' (resources/widgets.gui:2,1)
[2:07:56 PM] App: Error 22 Unknown attribute 'onActivate'
(resources/widgets.gui:2,1)
[2:07:56 PM] App: Error 22 Illegal top-level element (resources/widgets.gui:2,1)
[2:07:56 PM] App: Error 22 Illegal element 'document' (resources/widgets.gui:3,1)
[2:07:56 PM] App: Error 22 Invalid path './resources/widgets.gui'
[2:07:56 PM] App: Error 22 Failed to read SVGML './resources/widgets.gui'
[2:07:56 PM] App: App Started
[2:07:56 PM] App: Error 22 Critical glue error
[2:07:56 PM] App: Launch complete - durations: foregrounding(277ms), first paint(4ms), total(704ms).
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:07:57 PM] App: Error 22 Critical glue error
[2:08:00 PM] App: Error 22 Critical glue error
and my widgets.gui code looks like this:
```
``` my sdk version is 4.9.9 as that is the last sdk supported by versa 2, please help me solve this
Answered! Go to the Best Answer.
Accepted Solutions
04-14-2024 14:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 14:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I've never known that error to happen without excessive files.
app.fba is the build file. You can look within it by appending .zip to it (and there are more .zips within it). You could browse through there for something that doesn't belong.
If you haven't put a lot of time into this project yet, it might be quicker to start again, and build it regularly so you can see what change breaks it. To simplify the changes needed to adapt to Versa 2, you could try
npx create-fitbit-app myVersa2Project --sdk-version 4.3.0
Gondwana Software
04-14-2024 12:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 12:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
now im also getting this error when i try to install it: Install failed: Application bundle too large; reduce size and try again.

04-14-2024 12:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 12:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
That's not what a widgets.gui file should look like. One that works should have been created automatically when you created your project.
It almost looks like you're trying to use HTML in a Fitbit project.
And I don't recognise that sdk version.
Gondwana Software

04-14-2024 12:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 12:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I’m sorry, I am actually using sdk 4.2, also it didn’t create the file when I created the project because I had to manually change the sdk to support versa 2

04-14-2024 12:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 12:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
An equivalent file was probably created but with a slightly different name. You'll probably need to tweak its contents to suit the earlier SDK (import locations, etc).
Gondwana Software

04-14-2024 12:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 12:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 12:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 12:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
How would I know what the file that had the same contents? I created this file with an sdk above sdk 6
04-14-2024 13:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 13:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I think it's covered here.
Gondwana Software

04-14-2024 13:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 13:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Ahh, thank you, also when I try to install my app, it says Application bundle too large; reduce size and try again.

04-14-2024 13:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 13:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
If forced to guess, I'd say that you're probably trying to include large images or other resources.
Gondwana Software

04-14-2024 13:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 13:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Could you maybe help me out here if u have had a problem with it or smth like that before

04-14-2024 13:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 13:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Have you put any large files (eg, images) in your project (typically in resources subfolder)?
Gondwana Software

04-14-2024 13:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 13:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 13:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 13:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
The icon should only be a few kB. Look for other large files in your project folders (especially /resources, but ignore node_modules).
It's very hard to create a project with too much code, unless you've pasted stuff from a non-Fitbit project.
Gondwana Software

04-14-2024 14:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 14:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
the only 2 big files are app.fba (has a ton of stuff in it) and index.js which just has like 41 lines in it

04-14-2024 14:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 14:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I've never known that error to happen without excessive files.
app.fba is the build file. You can look within it by appending .zip to it (and there are more .zips within it). You could browse through there for something that doesn't belong.
If you haven't put a lot of time into this project yet, it might be quicker to start again, and build it regularly so you can see what change breaks it. To simplify the changes needed to adapt to Versa 2, you could try
npx create-fitbit-app myVersa2Project --sdk-version 4.3.0
Gondwana Software
04-14-2024 17:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-14-2024 17:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Thanks! All I needed to do is rebuild the project like you said. None of the files were the issue so I have absolutely no idea, but thanks!
04-14-2024 19:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-14-2024 19:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Excellent; well done. Maybe there was some cruft left over from the adaptation from SDK5+ to SDK4. "npm i" might have flushed it out.
Gondwana Software

