Error:(949) Multiple substitutions specified in non-positional format; Android格式化string.xml

string.xml问题代码

 

 

<string name="msg">书名:%s\n价格:%d</string>

 

 

 

 

 

异常信息

Error:(949) Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
Error:(949) Unexpected end tag string
Error:(949) Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
Error:(949) Unexpected end tag string
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

 

解决办法:

 

 
<string name="msg">书名:%1$s\n价格:%2$d</string>

 

posted @ 2019-07-08 23:47  趣学程序  阅读(190)  评论(0编辑  收藏  举报