question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Got exception: IllegalArgumentException: Missing closing brace: }

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
JoaquimLeycommented, Feb 26, 2019

@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}

0reactions
edenmancommented, May 2, 2022

This should be fixed in 1.2.0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found