02-17-2021 14:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

02-17-2021 14:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi Everyone,
I am testing the Fitbit CLI development, but when I try to compile a simple project, I see the following issue.
[23:21:26][error][build] package.json One or more build targets was invalid: mira
[23:21:26][error][build] package.json Error: Project configuration is invalid
My target is defined as:
"buildTargets": [
"mira"
],
and my dependencies are defined as:
"devDependencies": {
"@fitbit/sdk": "~4.2.0",
"@fitbit/sdk-cli": "^1.7.3"
},
It seems that everything must be okay, but this error indicates that mura is not a correct buildTarget. Mura is the target for Versa2 which is the watch I want to develop applications for.
Have you seen such issue and how have you resolved it?
Thank you for your help!
Answered! Go to the Best Answer.

Accepted Solutions
02-18-2021 10:22 - edited 02-18-2021 10:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

02-18-2021 10:22 - edited 02-18-2021 10:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
To elaborate on Gondwana, you might have 5.0.0+ installed locally, which would give you an invalid build target -- since that is for Sense and Versa 3.
Easy mistake if you scaffold from something like "create-fitbit-app" and unknowingly updated the configuration without reinstalling dependencies.
Screenshot of error when scaffolding, and trying to build with 5+.
Fix it by saving your package.json, and running `npm install` .

02-17-2021 15:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


02-17-2021 15:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Have you updated the node_modules?
Gondwana Software

02-18-2021 10:22 - edited 02-18-2021 10:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

02-18-2021 10:22 - edited 02-18-2021 10:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
To elaborate on Gondwana, you might have 5.0.0+ installed locally, which would give you an invalid build target -- since that is for Sense and Versa 3.
Easy mistake if you scaffold from something like "create-fitbit-app" and unknowingly updated the configuration without reinstalling dependencies.
Screenshot of error when scaffolding, and trying to build with 5+.
Fix it by saving your package.json, and running `npm install` .

02-18-2021 12:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

02-18-2021 12:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I followed the instructions here https://dev.fitbit.com/build/guides/command-line-interface/
But even following it, the npm installed an app with SDK 5.0 which I changed the version manually in package.json
Using your approach brh55 it really helped me, thank you!

05-10-2023 04:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-10-2023 04:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm having the same issue, so I ran "npm install" and had this response?
Please advise?

05-10-2023 13:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-10-2023 13:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@AnElbowBefore running "npm install", change into the directory that contains your project's package.json file.
Gondwana Software
05-11-2023 00:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-11-2023 00:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Alright, it seems I need to go back a few steps...
You can see the steps I followed here to create a test watchface.
Problem is I have a Versa 2 and it only offers me options for Versa 3 and Sense, so what I did last time is I edited the package.json to reflect my needs. Then tried to build the project and got this:
What I tried after reading your recommendation was I changed the directory to my app then used "npm install". I then tried to build and got this:
But this is all a bit ridiculous, there must be a more reasonable way of creating a project for a device other than the Versa 3 and Sense!
All the official tutorials and guides are worthless as they make absolutely no reference to this issue.
Any ideas what I am missing?

05-11-2023 01:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-11-2023 01:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
It's hard to see what's going on because the images are a bit small.
In addition to changing the build targets, did you change the SDK version to suit it?
After changing the SDK version, did you run "npm i" to adjust the node packages?
Gondwana Software

05-11-2023 02:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-11-2023 02:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Ah, it does appear that this forum compresses images somewhat, I didn't think it would do that. I guess I'll have to use Google Drive links in the future.
No, I didn't try "npm i" because I wasn't aware of it. Tried it and I still can't build the project because it still says that certain files are missing.
Is there a guide for developing for Versa 2? Because I feel like this whole nightmare could be avoided if the CLI allowed me to make a new clockface for the Versa 2 from the beginning, but the only options I get are Versa 3 and Sense. So I have to try to work backwards after creating the project and it's just so clumsy.

05-11-2023 08:46
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-11-2023 08:46
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
05-11-2023 14:18 - edited 07-31-2023 13:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-11-2023 14:18 - edited 07-31-2023 13:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
We really really really need a guide or FAQ on this topic!
In package.json, set "buildTargets" to suit the watch(es) on which you want your project to run. buildTarget values are as per the alias strings here. In addition, Versa 4 is "hera" and Sense 2 is "rhea", but SDKs for those devices haven't been released yet (more here).
Also in package.json, set "@fitbit/sdk" to an appropriate SDK version for your build targets. You can deduce the SDK broadly in terms of OS and firmware version here. In general, you should use the most recent relevant version of that SDK family, which you can determine from here. Note that the dependency in package.json should normally include a wildcard to allow more recent SDKs to be used, up to a point; eg, "~4.3.0" (details for the curious).
You can only specify one SDK version in package.json. This can limit the buildTargets you can easily support in any one project.
- Versa 2 and earlier watches can only be upgraded up to SDK4.
- Versa 3 and Sense (1) can only use SDK5 and SDK6.
SDK4 (<= Versa 2) doco can be found here.
The filename changes between SDK4- and SDK5+ are documented in the SDK5 announcement post in the dev blog. (Unfortunately, direct links to blog posts aren't permitted.) When going back the other way, those changes need to be reversed.
At the least, when changing from SDK5+ to SDK4-:
- index.view -> index.gui
- widget.defs -> widgets.gui
- In widgets.gui, change /mnt/sysassets/system_widget.defs to /mnt/sysassets/widgets_common.gui
Expect other changes due to API and screen size differences.
In general, the Fitbit Developer Blog often contains useful information on each major SDK version release.
I haven't tried it, but in theory it's possible to create a new project for a specific sdk version. From the parent directory to that in which you want your new project's files, to create a new Versa 2 project called myVersa2Project, there's a chance that something like this might work:
- npx create-fitbit-app myVersa2Project --sdk-version 4.3.0
Gondwana Software
05-11-2023 18:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-11-2023 18:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
05-12-2023 21:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-12-2023 21:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Guy_ Thanks! 😁 I think I've made the changes you suggested (using official documentation where possible).
The things I do for senior Gold Community Council members... 😉
Gondwana Software

05-12-2023 21:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-14-2023 22:43 - edited 05-14-2023 22:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-14-2023 22:43 - edited 05-14-2023 22:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Thank you, those changes you recommended at the beginning of your comment did allow me to move along a few more steps. I could build and install to the Fitbit OS Simulator. But alas, that document does not help as it is a tutorial for Fitbit Studio, which has been depreciated in favour of the CLI.
You are right, some real documentation would help, or at least a clear index that could lead me to it.
And "npx create-fitbit-app myVersa2Project --sdk-version 4.3.0" worked! THANK YOU! Your other recommendations are no longer needed after that, now I just need to figure out the easy stuff (I already have some familiarity with CSS and the rest in other contexts).
Correction: I can now start a project in the CLI for my Versa 2, but I still need a glossary as code from guides for later products is not recognized. Any ideas where I can find one?
05-15-2023 06:21 - edited 05-15-2023 06:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-15-2023 06:21 - edited 05-15-2023 06:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@Gondwana Well, I figured out what I needed to through trial and error and researching JavaScript
Here is the clockface I made, not amazing, but I just couldn't find what I wanted in the gallery and making it myself is quite satisfying.
I'm not going to bother making it pass review because I just wanted to personalise my own watch. Thank you for your help.
05-15-2023 13:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-15-2023 13:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@AnElbow Well done! Yes, it can be quite satisfying. The harder it is, the more satisfying it can be. 😉
Gondwana Software

06-14-2023 02:23 - edited 06-14-2023 02:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-14-2023 02:23 - edited 06-14-2023 02:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Dear @Guy_ and @Gondwana
I am using SDK 4.3.2 and while installing the app to the simulator it prompts an error saying -
App: Error 2 Invalid path '/mnt/sysassets/widgets/text_button.gui'
[3:16:51 PM] App: Error 22 Invalid value '' (mnt/sysassets/widgets/text_button.gui:1,1)
[3:16:51 PM] App: Error 22 Could not find symbol '#text-button' in recBtn (resources/index.gui:5,1)
[3:16:51 PM] App: Error 22 Undefined attribute 'href' in recBtn (resources/index.gui:5,1)
[3:16:51 PM] App: Error 22 Could not find symbol '#text-button' in xferBtn (resources/index.gui:6,1)
[3:16:51 PM] App: Error 22 Undefined attribute 'href' in xferBtn (resources/index.gui:6,1)
I am dyeing to solve this error. I have updated the node modules and all the possible solve that this community forum has discussed but failed. Any suggestions?
Thank you so much for the help.

06-28-2023 16:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-28-2023 16:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm stuck like everyone else. Any tips on where to get some files to copy over would help.
> fitbit-build
[19:48:24][error][build] package.json Display name must not be blank
[19:48:24][error][build] package.json Wipe color must be a valid hex color
[19:48:24][error][build] package.json At least one build target must be enabled
[19:48:24][warn][build] package.json Tiles available only for native components. Skipping tile configuration!
[19:48:24][error][build] package.json Error: Project configuration is invalid
Build failed with code: 1

06-28-2023 21:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


06-28-2023 21:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@statsdata How did you create the package.json file?
Gondwana Software
