Android Question (SOLVED) Error in strings.xml

Discussion in 'Android Questions' started by Johan Schoeman, May 17, 2015.

  1. Johan Schoeman

    Johan Schoeman Expert Licensed User

    I am using a strings.xml file in a B4A project

    Code:
    <resources>
        <
    string name="app_name">SpeedTest </string>
        <
    string name="network_edge">Network : EDGE </string>
        <
    string name="network_3g">Network : 3G </string>
        <
    string name="network_detecting">Network : Detecting </string>
        <
    string name="update_speed">%s kbit/sec </string>
        <
    string name="update_downloaded">Downloaded %s of %s </string>
        <
    string name="update_connectionspeed">Connection time %s ms</string>
        <
    string name="update_downloaded_complete" formatted="false">Downloaded %s at %s kbit per sec</string>
    </resources>
    It generates the following error when compiling the B4A project:

    B4A version 4.30
    Parsing code. 0.00
    Running custom action. 0.05
    Compiling code. 0.03
    Compiling layouts code. 0.00
    Generating R file. Error
    res\values\strings.xml:25: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
    res\values\strings.xml:25: error: Unexpected end tag string

    This line generates the error:

    <string name="update_downloaded_complete" formatted="false">Downloaded %s at %s kbit per sec</string>

    I have added formatted="false" but the error still come up. Does anyone have a solution for this?

    EDIT: This fixed it
    Code:
    <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
       
        <
    string name="app_name">SpeedTest</string>
        <
    string name="network_edge">Network : EDGE</string>
        <
    string name="network_3g">Network : 3G</string>
        <
    string name="network_detecting">Network : Detecting</string>
        <
    string name="update_speed">%s kbit/sec</string>
        <
    string name="update_downloaded" formatted="false">Downloaded %s of %s</string>
        <
    string name="update_connectionspeed">Connection time %s ms</string>
        <
    string name="update_downloaded_complete" formatted="false">Downloaded %s @ %s kbit/sec</string>
    </resources>
     
    Last edited: May 17, 2015
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice