Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fitbit studio issue

ANSWERED

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:

```

<document xmlns="http://www.fitbit.com/ns/ui">
  <button id="openRobloxButton" width="100%" text="Open Roblox PC" onActivate="openRoblox" />
</document>

``` my sdk version is 4.9.9 as that is the last sdk supported by versa 2, please help me solve this
Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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
Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
17 REPLIES 17

now im also getting this error when i try to install it: Install failed: Application bundle too large; reduce size and try again.

Best Answer
0 Votes

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.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

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

Best Answer
0 Votes

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).

Peter McLennan
Gondwana Software
Best Answer
0 Votes
Plus, I’m new to doing Fitbit projects so I honestly don’t know how to fix it
Best Answer
0 Votes

How would I know what the file that had the same contents? I created this file with an sdk above sdk 6

Best Answer

I think it's covered here.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Ahh, thank you, also when I try to install my app, it says Application bundle too large; reduce size and try again.

Best Answer
0 Votes

If forced to guess, I'd say that you're probably trying to include large images or other resources.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Could you maybe help me out here if u have had a problem with it or smth like that before

Best Answer
0 Votes

Have you put any large files (eg, images) in your project (typically in resources subfolder)?

Peter McLennan
Gondwana Software
Best Answer
0 Votes
I only have 1 image in there for the app icon
Best Answer
0 Votes

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.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

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

Best Answer
0 Votes

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
Peter McLennan
Gondwana Software
Best Answer

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!

Best Answer

Excellent; well done. Maybe there was some cruft left over from the adaptation from SDK5+ to SDK4. "npm i" might have flushed it out.

Peter McLennan
Gondwana Software
Best Answer
0 Votes