Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 16    Views: 256

PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
Fourm Star
02/25/14 10:32 PM (8 years ago)

The JSON data for this app is invalid

Eeek! I've just re-published and downloaded my files, and Xcode gives me this error message: "The JSON data for this app is invalid. Restart the app to try again." JSONLint says it's all good JSON... has anyone else had this error? (I've re-started the iOS simulator and Xcode twice each, same result.) I am noticing that there is often repetition in the object definitions appearing in BT_config.txt, eg: {"itemId":"1D8B6BFE1774B5B8579668B", "itemType":"BT_screen_menuListSimple", "itemNickname":"Home menu", "itemId": "1D8B6BFE1774B5B8579668B", "itemType": "BT_screen_menuListSimple", "itemNickname": "Home menu", "navBarTitleText": "Home Menu", "navBarBackgroundColor": "#00CCFF", "navBarStyle": "solid", "navBarRightButtonType": "next", etc. It's in several objects and is always the first three definitions that are repeated. Is that odd or have I just not noticed before, and could that be a cause? (Note: removing those duplicate parameters didn't change anything, I still got the same error message.) Cheers Paddy.
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
Fourm Star
like
02/25/14 11:36 PM (8 years ago)
Problem solved (though I don't know why...). Copied and pasted all the config code from the BT Control Panel directly into the BT config file as seen through Xcode, ran it on the simulator and it worked. It's still doubling up on those first three parameters in some objects, but who am I to question the logic?!! It works, that's all that matters. :) <phew>
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
Fourm Star
like
02/27/14 01:58 AM (8 years ago)
Great detective work and thanks for posting the solution! Farcat
 
SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
like
03/03/14 03:12 PM (8 years ago)
I am having the same problem now. Where do I find BT control panel to try above? thanks
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
Fourm Star
like
03/03/14 03:16 PM (8 years ago)
Click for the "JSON Data" button.
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
Fourm Star
like
03/03/14 08:24 PM (8 years ago)
.. or if your web interface looks like mine, look for "Configuration Data" in the menu list on your app's Control Panel. As @farcat says, it's just JSON data. Copy that, then open Xcode and look for the BT_config.txt file in your project. View its contents, then paste the JSON into it to completely replace what's there. That seemed to work for me.
 
SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
like
04/07/14 11:58 AM (8 years ago)
I have this same problem. My android app works fine. Then I download the zip file, open in Xcode and then copy across the BT_images and BT_pluggins folders and it run's fine. Then I get the JSON error asking me to re-start! I have tried the copy paste advice PaddyO, can someone please help? I'm tearing my hair out :(
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
Fourm Star
like
04/08/14 12:31 AM (8 years ago)
Have you then copied the config data across into the config file in Xcode as well? (though if it's a new build it 'shouldn't' need it.) And cleaned it etc etc? It's always worth starting Xcode from scratch again, cleaning, cleaning, cleaning... And make sure that you've closed down the simulator as well and only restart it through Xcode. Basically, you want to close everything down and reload your BT project into Xcode as though it was the first time ever. Sorry if you've tried all this, but it's my standard first trouble-shoot now - I find that there's usually some shred of memory left in there somewhere that hangs onto a bit of the previous version and it always seems to make it perplexing. (Yep, a very technical explanation that!) It might also be worth checking that the JSON is actually valid too - at least you'll know that it is (or isn't) the cause. Cheers Paddy
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
Fourm Star
like
04/08/14 12:32 AM (8 years ago)
.. alternatively, shut your machine down, go and have 3 beers and look at it tomorrow. Always seems to work better that way. :)
 
SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
like
04/12/14 08:09 AM (8 years ago)
I went through a JSON validation tool and got this: Parse error on line 446: ... "questionText": "A 19-year-old nulli -----------------------^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[' How do I find which part needs fixing? I have had many beers and headaches....not sure if from beers or app!
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
Fourm Star
like
04/18/14 06:35 AM (8 years ago)
Is that the full line of code SM? Seems like half is missing - can you post more? Cheers Paddy.
 
LADO
Apple Fan
Profile
Posts: 8
Reg: Mar 20, 2014
Waterford, Irel...
3,780
Fourm StarFourm Star
like
04/27/14 06:42 AM (8 years ago)
I have the same problem, thank you for your help. Regards, John
 
kingelessar
Lost but trying
Profile
Posts: 155
Reg: Mar 10, 2014
UK
6,500
Fourm Star
like
05/19/14 03:41 AM (8 years ago)
Having just had the same problem running the app on a device (though the simulators were fine), I found the only thing that worked, after trying a clean, delete app from device, restart everything, delete cached data etc., was a re-download of the ios package from BT.
 
330ministries
buzztouch Evangelist
Profile
Posts: 15
Reg: Sep 19, 2012
Owasso, OK
2,900
Fourm Star
like
02/18/15 05:51 AM (7 years ago)
I tried everything above and nothing worked on the simulator. Everything worked fine on a device. I even reset the content and settings of the simulator...still nothing. Then I copied the Configuration Data URL from the Core Properties, pasted it into my browser and copied the Config Data from it. It launched fine and the simulator worked great with this. No reason why this worked but it did.
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
01/30/16 11:18 PM (6 years ago)
I'm on my first BT project, concentrating mainly on the iOS app. I'm getting the same error ( "The JSON data for this app is invalid" ) on both the simulator and the actual iPhone device. I tried the trick listed here (pasting the config text straight into the Xcode side), but with no luck. I have republished and re-downloaded the project also.
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
01/30/16 11:46 PM (6 years ago)
I went to jsonlint.com and found that one of my latitude entries for a mapping instance, apparently had a tab at the start of the data. After I removed that, the invalid JSON error went away, but it was replaced by this one: "There was a problem reading some required data. Try again?" Still working on it.
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
01/31/16 12:33 AM (6 years ago)
After going after the offending map entry, and then rebuilding the download, it seems to be working.
 

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.