【我的Android进阶之旅】解决strings.xml格式化占位符错误: Multiple substitutions specified in non-positional format

本文介绍了在Android开发中遇到的strings.xml文件格式化错误,即Multiple substitutions specified in non-positional format的问题。错误原因是使用了非位置格式的多个替换占位符,解决方案是将%s改为%1$s的格式。通过修改strings.xml,重新编译后问题得到解决。
摘要由CSDN通过智能技术生成

今天有一个Android新手使用strings.xml进行格式化的时候报了占位符错误, Multiple substitutions specified in non-positional format; did you mean to add the formatted=“false” attribute? ,问我该如何解决?

一、错误描述

具体错误描述如下所示:

D:\Code_For_Android_Studio\MyGame2048\app\build\intermediates\res\merged\debug\values\values.xml
Error:(16) Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
Error:(16) Unexpected end tag string
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'F:\AndroidStudio\sdk\build-to
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

字节卷动

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值