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

help with svg

i need help with svg buttons in sdk 4.3

Best Answer
0 Votes
9 REPLIES 9

Guide.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

i used the code but i got this error: [5:26:35 PM] App: Error 22 Could not find symbol '#push-button' in button1
(resources/widgets.gui:3,1)
[5:26:35 PM] App: Error 22 Undefined attribute 'href' in button1
(resources/widgets.gui:3,1)
[5:26:35 PM] App: Error 22 Could not find element '#text' (resources/widgets.gui:4,1)
[5:26:35 PM] App: Error 22 Could not find element '#text' (resources/widgets.gui:5,1)
[5:26:35 PM] App: Error 22 Could not find element '#text' (resources/widgets.gui:6,1)
[5:26:35 PM] App: Error 22 Unclosed element 'svg' in unnamed (resources/widgets.gui:7,1)
[5:26:35 PM] App: Error 22 Illegal element 'svg' (resources/widgets.gui:8,1)

i have my @Fitbit/sdk version at 4.3.0

 

Best Answer
0 Votes

What have you put in your widgets.gui?

Peter McLennan
Gondwana Software
Best Answer
0 Votes

<svg>
<use id="button1" href="#push-button" y="50" height="60"
fill="fb-red" font-family="System-Regular" font-size="40">
<set href="#text" attributeName="text-buffer" to="Click Me!" />
<set href="#text" attributeName="fill" to="fb-peach" />
<set href="#text" attributeName="y" to="12" />
</use>
</svg>

Best Answer
0 Votes

That shouldn't be in widgets.gui. Please look at the guide again.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

what should be in widgets.gui then?

Best Answer
0 Votes

The guide covers this.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

ahh, i see, i put "<svg>
<defs>
<link rel="stylesheet" href="styles.css" />
<link rel="import" href="/mnt/sysassets/widgets_common.gui" />
<!-- Additional Imports -->
<link rel="import" href="/mnt/sysassets/widgets/push_button_widget.gui" />
</defs>
</svg>" in widgets.gui and "<svg>
<use id="button1" href="#push-button" y="50" height="60"
fill="fb-red" font-family="System-Regular" font-size="40">
<set href="#text" attributeName="text-buffer" to="Click Me!" />
<set href="#text" attributeName="fill" to="fb-peach" />
<set href="#text" attributeName="y" to="12" />
</use>
</svg>" in index.gui but i get these errors: [5:05:39 PM] App: Error 22 Could not find symbol '#push-button' in button1 (resources/index.gui:3,1)
[5:05:39 PM] App: Error 22 Undefined attribute 'href' in button1 (resources/index.gui:3,1)
[5:05:39 PM] App: Error 22 Could not find element '#text' (resources/index.gui:4,1)
[5:05:39 PM] App: Error 22 Could not find element '#text' (resources/index.gui:5,1)
[5:05:39 PM] App: Error 22 Could not find element '#text' (resources/index.gui:6,1)
[5:05:39 PM] App: Error 22 Unclosed element 'svg' in unnamed (resources/index.gui:7,1)
[5:05:39 PM] App: Error 22 Illegal element 'svg' (resources/index.gui:8,1)

Best Answer
0 Votes

I can't see anything obvious wrong with that. Make sure package.json has a suitable sdk version (4.something), then try 'npm i' to refresh the node_modules.

Pro tip: when posting here, if you click on '...', you'll see a button for pasting code samples. That makes them much easier to read, which can help others to spot problems. 🙂

Peter McLennan
Gondwana Software
Best Answer
0 Votes