Got exception: IllegalArgumentException: Missing closing brace: }
See original GitHub issueHi there,
The following string and the invocation of Phrase got me this exception every time. Could someone take a look and tell me what went wrong? Thanks! :
<string name="example_string">{aaa} (Now {bbb})</string>
Phrase.from(this, R.string.example_string)
.put("aaa", getAaa())
.put("bbb", getBbb())
.format()
This is the exception:
Exploded trying to parse content: java.lang.IllegalArgumentException: Missing closing brace: }
at com.squareup.phrase.Phrase.key(Phrase.java:245)
at com.squareup.phrase.Phrase.token(Phrase.java:221)
at com.squareup.phrase.Phrase.<init>(Phrase.java:204)
at com.squareup.phrase.Phrase.from(Phrase.java:112)
at com.squareup.phrase.Phrase.from(Phrase.java:103)
at com.squareup.phrase.Phrase.from(Phrase.java:94)
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
scalac missing closing brace error reports with weird line ...
However, scalac reports that it "assumes" a missing closing brace in the middle of a previous case class declaration (on line 7). (The...
Read more >[Solved]-Why is the exception "IllegalArgumentException: Missing ...
Coding example for the question Why is the exception "IllegalArgumentException: Missing closing quote on line '"'"-scala.
Read more >java.lang.IllegalArgumentException: Unmatched braces in the ...
In my Struts JSP application I get the following error when I save a record. ... IllegalArgumentException: Unmatched braces in the pattern.
Read more >Closing braces not being automatically inserted in Java
I noticed that Netbeans was no longer automatically inserting closing braces. For instance, when I type this: public void mymethod() ...
Read more >E2134 Compound statement missing closing brace (C++)
The compiler reached the end of the source file and found no closing brace. This is most commonly caused by mismatched braces.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@genius1wjc can you post the actual text you have on Phrase instead of the Android resource?
For anyone visiting this issue, I just solved it by using
snake_case
, the error message is quite ambiguous imo but if someone has a key on phrase{writtenLikeThis}
try to change it to{written_like_this}
This should be fixed in 1.2.0