Discussion Forums  >  Self Hosted Control Panels

Replies: 6    Views: 71

devapps123
Apple Fan
Profile
Posts: 48
Reg: Jul 12, 2012
Sarasota, FL
480
06/17/17 05:54 AM (6 days 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: 792
Reg: Feb 20, 2011
Rockwall, TX
17,220
like
06/18/17 07:09 AM (5 days 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: 48
Reg: Jul 12, 2012
Sarasota, FL
480
like
06/18/17 04:23 PM (4 days 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: 6213
Reg: Nov 07, 2012
Tamuning, GU
80,380
like
06/18/17 05:08 PM (4 days 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: 2556
Reg: Mar 05, 2012
Esher, UK
36,560
like
06/22/17 12:57 PM (21 hours 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: 6213
Reg: Nov 07, 2012
Tamuning, GU
80,380
like
06/22/17 03:09 PM (19 hours 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: 2556
Reg: Mar 05, 2012
Esher, UK
36,560
like
06/23/17 12:11 AM (10 hours 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....
 

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.