1

I'm building a watch face using the WFF format...

The XML reference documentation says it is possible to create presets configurations, so called "flavors", however they don't show on the watch face editor (phone or watch). It is like the editor is ignore this setting.

watchface.xml

<UserConfigurations>
 
      <!--My configurations -->

      <Flavors defaultValue="0">
            <Flavor id="0" displayName="flavor_one" icon="flavor_one_icon">
                <Configuration id="fontClock" optionId="0"/>
                <Configuration id="clockMainColor" optionId="1"/>
            </Flavor>

            <Flavor id="1" displayName="flavor_two" icon="flavor_two_icon">
                <Configuration id="fontClock" optionId="2"/>
                <Configuration id="clockMainColor" optionId="0"/>
            </Flavor>
        </Flavors>
</UserConfigurations>
  • I already checked the ids, they are all correct;
  • String file contains the names, all correct, I tested them on others settings and they work/show;
  • The icons are 150x150 (like google's sample), I also tried 300x300, 350x350, 360x360 (max, according to the doc), 400x400, 450x450;
  • I tried without icons;
  • I tried adding displayName to the Flavors tag;
  • Tested on watch and emulator.

I also added the required tags on the watch_face_info.xml

<?xml version="1.0" encoding="utf-8"?>
<WatchFaceInfo>
    <Preview value="@drawable/preview"/>
    <AvailableInRetail value="false"/>
    <MultipleInstancesAllowed value="true"/>
    <Editable value="true"/>
    <FlavorsSupported value="true"/>
</WatchFaceInfo>

just in case, my manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-sdk
        android:minSdkVersion="34"
        android:targetSdkVersion="34" />

    <uses-feature
        android:name="android.hardware.type.watch"/>

    <application
        android:label="@string/watch_face_name"
        android:hasCode="false">

        <meta-data
            android:name="com.google.android.wearable.standalone"
            android:value="true" />

        <property
            android:name="com.google.wear.watchface.format.version"
            android:value="2" />
    </application>
</manifest>

Anyone knows what is wrong?? Thanks!

1 Answer 1

0

This is happenening because the <Flavor> elements are referencing configuration IDs that haven’t been defined. In the watchface.xml, you need to first declare all the configuration options you’re using in your flavors like <ListConfiguration>, <ColorConfiguration>, or <BooleanConfiguration>before the <Flavors> block. Without these, the system silently ignores the flavors because there’s nothing to apply.

<UserConfigurations>
  <ListConfiguration id="fontClock" displayName="Font" defaultValue="0">
    <ListOption id="0" displayName="Font A"/>
    <ListOption id="1" displayName="Font B"/>
    <ListOption id="2" displayName="Font C"/>
  </ListConfiguration>

  <ColorConfiguration id="clockMainColor" displayName="Clock Color" defaultValue="0">
    <ColorOption id="0" displayName="White" colors="#FFFFFF"/>
    <ColorOption id="1" displayName="Red" colors="#FF0000"/>
  </ColorConfiguration>

  <Flavors defaultValue="0">
    <Flavor id="0" displayName="flavor_one" icon="flavor_one_icon">
      <Configuration id="fontClock" optionId="0"/>
      <Configuration id="clockMainColor" optionId="1"/>
    </Flavor>
    <Flavor id="1" displayName="flavor_two" icon="flavor_two_icon">
      <Configuration id="fontClock" optionId="2"/>
      <Configuration id="clockMainColor" optionId="0"/>
    </Flavor>
  </Flavors>
</UserConfigurations>

Also double-check that watch_face_info.xml includes <FlavorsSupported value="true"/>, and that your AndroidManifest.xml sets the correct format version ("com.google.wear.watchface.format.version" = 2) and SDK target (min and target 34+). Flavors only show up in the customization UI of the companion app, not in Android Studio preview, so be sure you’re testing on a physical watch or emulator with the latest companion experience. Once the configurations and flavor references are properly set up, I'm pretty sure the presets should appear as expected.

Sign up to request clarification or add additional context in comments.

1 Comment

1) As I said ("I already checked the ids"), they are defined... the "My configurations" comment is the code I didn't added here on the post. 2) the version is set in the manifest (as you can see in the code i posted). 3) min version is also set to 34 (in the post). 4) My main devide is a real watch and a real phone, but is not showing, even on emulators (as I said in the post)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.