Format string XXX is not a valid format string so it should not be passed to String.format

I just copied the code and it works well. so you may need to check some other place,Here are my suggestions.

  1. clean project
  2. check multi-language files
  3. or just use String.format just like others said

Set parameter formatted to true in resources:

<string name="some_text" formatted="true">
    Use for String.format method. Parameter one: %s1
</string>

and use this way:

String.format(context.getString(R.string.some_text,"value 1"))

or this way:

context.getString(R.string.some_text,"value 1"))

Note:formatted flag should be set to true only for strings with placeholders


Try File -> Invalidate Caches / Restart..., it fixed the problem for me.