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:
```
Answered! Go to the Best Answer.
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
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.
Best AnswerI’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
Best AnswerAn 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).
Best AnswerAhh, thank you, also when I try to install my app, it says Application bundle too large; reduce size and try again.
Best AnswerIf forced to guess, I'd say that you're probably trying to include large images or other resources.
Best AnswerHave you put any large files (eg, images) in your project (typically in resources subfolder)?
Best AnswerThe 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.
Best Answerthe 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
Best AnswerI'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
Excellent; well done. Maybe there was some cruft left over from the adaptation from SDK5+ to SDK4. "npm i" might have flushed it out.
Best Answer