Is there a way to get more verbose compiler output for 'ERROR: For input string: "Activity"'?

I'm getting the compile time error:

ERROR: For input string: "Activity"

<settings>
    <setting propertyKey="@Properties.Metric" title="@Strings.MetricLabel">
        <settingConfig type="list">
            <listEntry value="Activity">@Strings.ActivityLabel</listEntry>
            <listEntry value="Calories">@Strings.CaloriesLabel</listEntry>
        </settingConfig>
    </setting>
<settings>    

I can't figure out why it is complaining about the "Activity". It seems to be a general error, not specific to that entry. If I change the order of my listEntry and put "Calories" first in the list, the error message will be 'ERROR: For input string: "Calories"'.

Is there a way to get more verbose output as to what the problem is. All my resource files appear to be parsing correctly

  • I can't edit the question, but my XML does actually end with a properly closed /settings tag.

  • I couldn't figure out how to make this work with strings, so I changed the property to be numbers. Numbers is probably a better solution anyways.

    <settings>
        <setting propertyKey="@Properties.Metric" title="@Strings.MetricLabel">
            <settingConfig type="list">
                <listEntry value="0">@Strings.ActivityLabel</listEntry>
                <listEntry value="1">@Strings.CaloriesLabel</listEntry>
            </settingConfig>
        </setting>
    </settings>    

  • I agree that the error message is a bit vague, but the programmer's guide does specify that list settings are only for number properties.

    developer.garmin.com/.../

    Also, if you set the property type itself to "string", and use it with a list setting, you do get a more intelligible error message such as:

    BUILD: ERROR: The setting defined for property 'myProperty' is an invalid setting type (LIST) for the property type 'STRING'.

  • I guess in a round about way the docs do imply that a settingConfig using a list has to be a number. The docs state that if your *property* is a number, valid config types are list, numeric and date. But they also state in reference to listEntry values: "The type of the value should match the property it’s being saved to. If it doesn’t match a compile time error is thrown." I read that as saying, as long as the types match, it should work. I think it would be helpful if the listEntry section of the docs mentioned that values have to be numbers and the property has to be "number".

    Thanks for the help!

  • You're welcome!

    Well, this is the full table of property types and valid settingsConfigs -- the only property type which supports a list settingsConfig is number.

    Property Type Valid settingsConfig Types Notes
    string alphaNumeric, phone, email, url, password
    number list, numeric, date
    float numeric
    boolean boolean
    The type of the value should match the property it’s being saved to. If it doesn’t match a compile time error is thrown." I read that as saying, as long as the types match, it should work.

    Not to be pedantic, but it's saying that if the types don't match, it doesn't work. It doesn't imply that if the types match, it will work.

    I know that it makes it sound like there's more than one possible type of property in this case -- that could just be a case of writing things as generically as possible. That way, if more types are available in the future, that part of the text doesn't have to be rewritten.