Discussion Forums  >  Self Hosted Control Panels

Replies: 10    Views: 505

devapps123
Apple Fan
Profile
Posts: 50
Reg: Jul 12, 2012
Sarasota, FL
500
06/17/17 05:54 AM (6 years ago)

SyntaxError: Duplicate key 'itemId' - Cannot download app package from self-hosted panel.

I am trying to download the app package from the self-hosted panel for an Android project. I did this same process with another app 2 days ago with no issues. I've run the JSON throughJSONLint and the following error comes up: SyntaxError: Duplicate key 'itemId' It appears that the 'itemId' for each plugin is being listed 2 times in the JSON and causing the error. I have tried recompiling the app, editing the JSON, rebuilding the screens from scratch, and updating the plugins. All of my software and plugins are up to date. Please advise. I don't understand what is causing this issue and I've gone through every remedy I've been able to find in the forums. Thank you.
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
06/18/17 07:09 AM (6 years ago)
This problem evident in self hosted too. More of a nuisance than anything, doesn't seem to actually break anything except JSON validation might fail. Bug was reported several times.
 
devapps123
Apple Fan
Profile
Posts: 50
Reg: Jul 12, 2012
Sarasota, FL
500
like
06/18/17 04:23 PM (6 years ago)
Thank you for your reply, @WolfTimJ. The problem is that the system will not allow me to download the package. I would just debug it if I could download it, but I cannot even do that. Any suggestions?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/18/17 05:08 PM (6 years ago)
You can go into the database and manually remove the duplicate values. Be very careful about what you cut; it still has to remain JSON compliant. You'll find them in the 'JsonVars' field of the 'items' database. It's a little cumbersome. You need to use your phpMyAdmin to get it done. Cheers! -- Smug A half hearted example can be seen at https://www.marianasgps.com/public/btbug.png
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/22/17 12:57 PM (6 years ago)
@devapps123, I don't believe duplication in the json has an effect on the project.I downloaded a fresh app today, seems ok. I could build and run on a device. What problem are you seeing?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/22/17 03:09 PM (6 years ago)
Alan, jsonlint gives 'errors' when you have duplicate key/value pairs. The JSON provided by the BT infrastructure intermittently 'adds' ItemID, ItemType, and ItemNickname to the 'JsonVars' field, effectively duplicating those key/values. Cheers! -- Smug
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/23/17 12:11 AM (6 years ago)
Hi Smug, I understood. Json duplication is a feature, not a bug. The core has been doing this for a while and we know it doesn't affect an app. I thought perhaps @devapps123 has a problem stopping him from working and was I was thinking maybe he was thinking the json duplication was causing the problem. I am going to stop thinking for a bit....
 
devapps123
Apple Fan
Profile
Posts: 50
Reg: Jul 12, 2012
Sarasota, FL
500
like
06/23/17 05:35 PM (6 years ago)
Hi, @AlanMac. The issue is not with the app functionality. I haven't even been able to download the package from the self-hosted panel. See screen grab here: https://www.dropbox.com/s/cy492ojhh01dc8a/Screenshot%202017-06-23%2020.34.32.png?dl=0
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/24/17 01:13 AM (6 years ago)
I don't recall ever seeing this before, but looking at your screenshot, I am thinking this may be a packaging problem. I'm wondering if possibly you are using a plugin that is not BT4 compatible? The fact that you packaged and downloaded another app project successfully is the clue that leads me to think it is a plugin. I would do the following: 1) Convince myself that I can still download and compile a simple project to make sure nothing has changed in the last couple of days. 2) See if any of the plugins being used in the problem project have been updated in 2017 by looking at the last published update. Many, if not most, haven't. 3) Remove plugins from the download one by one, attempting a download after each until you don't have the packaging error. I would do this a the point where you select the plugins needed that you want BT to package. 4) If none of the above work I would start from scratch and make a new project, adding plugins one by one. Basically the reverse of 3). Good luck, Alan
 
devapps123
Apple Fan
Profile
Posts: 50
Reg: Jul 12, 2012
Sarasota, FL
500
like
06/24/17 07:06 AM (6 years ago)
Hi @AlanMac. Thank you for the suggestions. I was only using core plugins so I didn't even consider that possibility. It turns out you are correct. The plugin that appears to be causing the issue is HTML Pro. This is pretty fundamental. It's disappointing that the system isn't being maintained.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/24/17 08:57 AM (6 years ago)
Hi, I am glad my hunch played out. One last suggestion, report the plugin problem here: http://www.buzztouch.com/forum/thread.php?fid=A29BA604F7D8E5475ABEC28&tid=A29BA604F7D8E5475ABEC28 I believe the author of html pro will want to know.
 

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.