res/valuses/string.xml中定义字符串处错误,出错处如下:<string name="position_info">经度:%+.6f, 纬度:%+.6f</string>错误提示:
Multiple annotations found at this line:
- error: Multiple substitutions specified in non-positional format; did you mean to 
 add the formatted="false" attribute?
- error: Unexpected end tag string

解决方案 »

  1.   

     出现这个错误通常是因为 string.xml中的 % 导致编译失败, 下面是正确的使用方法::
    <string name="welcome_messages">Hello, %1$s! You have %2$d new messages.</string>如何在<string></string>中使用%号
    有两个办法可供选择
    1.用%%来表示1个%,和转意符号 \ 的用法相同
     
    2.如果你的字符串不需要格式化,可以在你的<string 标签上增加一个属性:formatted="false"例如 <string name="test" formatted="false">% test %</string> 即可
      

  2.   

    修改成:<string name="position_info">经度:%1$+0.6f, 纬度:%2$+0.6f</string> 即可,我已经验证过了。
      

  3.   

    修改成 <string name="position_info">经度:%1$+0.6f, 纬度:%2$+0.6f</string>即可,我已经验证过了。