I added this line to my strings.xml, and it wont compile into R.<string name="cl_txt_verinfo">List Version: %1$s\nAuthor: %2$s\nDate Created: %3$s\nLanguage: %4$s</string>
the errors i get are:
error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute? error: Unexpected end tag string
I want to ask how to make this work(i will use string.format later) and what does "formatted=false" do as opposed to not adding it/add it as true.
Edit: Clean and build is how I got this error. I got it so many times. But then I deleted an empty line and clean and rebuild everything is fine. This is really inconsistent and i have no idea what's causing the problem in the first place.
Two questions left:
This is not the only time i had an error then it magically fixes itself. sometime i restart my adt and it resolves itself, but not this time sadly.
If you added formatted=false
then format specifiers(%
,$
etc.) in your string resource are disabled and Formatter won't be able to recognize them. This will definitely help you.
For your 2nd problem there is no exact solution but what I do is delete gen and bin folder and then clean build project. What happens is every time you build a project, android checks if there is any new resource available and adds it to R.java and only after that you can use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With