Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 5    Views: 410

chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
10/13/12 07:43 PM (11 years ago)

config.txt - unrecognized leading character

After creating a custom JSON file for my config.txt, I'm getting the following error: 2012-10-13 21:30:02.204 appname[73002:c07] BT_application: ERROR parsing JSON in validateApplicationData: ( "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 "Unrecognised leading character" UserInfo=0x87c5cc0 {NSLocalizedDescription=Unrecognised leading character}" ) Is there any way to identify where in the file this error is occurring? When I parse the file through the JSON validation tool, it says it is valid JSON.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
10/13/12 08:21 PM (11 years ago)
Lots of time this is due to a ` instead of a ' being used in your text somewhere. That's the first think I'd look for. I think I've also seen it due to slashes (/ or \) being used. And, if you are using any non-English characters, sometimes that does it. Mark
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/13/12 08:57 PM (11 years ago)
I combed through the file and found multiple errors - although oddly enough none that would seem to indicate the problem above (no single quotes, curly quotes, or backslashes). But, the problem seems to be gone for now.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
10/13/12 09:23 PM (11 years ago)
Well, one of the errors you corrected must have fixed it! Either way, good job!
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
10/14/12 02:58 AM (11 years ago)
You could also try your json text on http://jsonlint.com to validate it. It should show you where the problems are.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/14/12 08:31 AM (11 years ago)
Thanks ictguy - I was using that and it showed valid JSON the entire time. What I came to find out, though, is that the JSON output my browser displayed was not what the same url produced in app. I figured this out by plugging the url into jsonlint.com, rather than copying and pasting the output. I never really figured out why this occurred, but in correcting several of the errors I found when combing through the file, it fixed itself. **edit** Make that one of the other json validation tools online. jsonlint.com doesn't have an option for using a url.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.