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>




已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 撸撸猫 设计师:C马雯娟 返回首页