Android Question An item with the same key has already been added.

David J. Smith

Member
Licensed User
Longtime User
Since B4A 5.2 I have been unable to reinstall one large app. During the installation process I get the following message in the compile (Build: Default) dialog:

B4A version: 5.20
Parsing code. (0.50s)
Compiling code. (0.92s)
Compiling layouts code. Error
An item with the same key has already been added.
Error File: splash.bal
Go to the designer script page to debug this error.

I have read similar posts and have tried several fixes that were suggested but none have worked for me. My problem appears to be in the Designer window but I do not know how to troubleshoot this. Any suggestions would be appreciated. Thank you.
 

JonPM

Well-Known Member
Licensed User
Longtime User
Are you able to upload a smaller project that produces the same error? Or maybe post your designer scripts code in splash.bal with a screenshot of the Views Tree tab
 
Upvote 0

David J. Smith

Member
Licensed User
Longtime User
I can do that but, before I do, I thought I would mention another problem I have just found out I have had since installing B4A 5.2. I went back to a couple of smaller apps I had developed and tried to reinstall them using the B4A Bridge as I always do. From B4A they appeared to install and the compile dialog said they had completed successfully, but the bridge screen remained visible on my phone. Before it would change to an INSTALL screen and then an OPEN screen. I then found the icon for my app and opened the app manually. The app worked but I did get the error message saying "android.system.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)". When I closed my app the message remained. I had to reboot to get rid of it. The next time I made a minor change to an app and no changes were transferred to my phone. I wonder if this and my previous problem are connected in some way.
 
Upvote 0

iwdev

Member
Licensed User
Longtime User
I just download the "Net.zip" and extract to specific folder and add to additional Libraries in paths configuration,when I press "ok" button,all the library disappear. When I refresh the library,it shows "An item with the same key has already been added." ,what should I do? thanks in advance.
 

Attachments

  • a.JPG
    a.JPG
    96 KB · Views: 243
Upvote 0

iwdev

Member
Licensed User
Longtime User

Attachments

  • log.txt
    526 bytes · Views: 258
Upvote 0

iwdev

Member
Licensed User
Longtime User
Move all the libraries from the additional libraries folder and try it again. Do you still get this error?

Yes, the error still happens.
The additional libraries folder only exists the extraction files of net.zip (see attachment a2.JPG)
 

Attachments

  • a2.JPG
    a2.JPG
    138.2 KB · Views: 244
Upvote 0

iwdev

Member
Licensed User
Longtime User
Remove the additional libraries path from this dialog. Does it still happen?

Yes,it works perfect,but I need the library function for FTP to samba.
I know what the problem is. I had copied a external library into B4A library folder(JhsIceZxing1),because I can't read this library through additional library.
I remove the external library from B4A folder and everything seems fine now,thanks.
 
Last edited:
Upvote 0

iwdev

Member
Licensed User
Longtime User
Hi,Erel.
Does the method of FTP.AppendFile append JPG file?
I try the following code,but "mix.jpg" can only see "1.jpg" although the file size have been changed.
(My app is to take one or two or 4 pictures,combine into one and then ftp to samba)

FTP.UploadFile(File.DirRootExternal, "1.jpg", False, "mix.jpg")
FTP.AppendFile(File.DirRootExternal, "2.jpg", False, "mix.jpg")
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Does the method of FTP.AppendFile append JPG file?
It does append the bytes to the exiting file. Note that a jpg can be damaged then because there are more data as expected. It does not "mix" the image...

You can upload a jpg, append a zip and then append a worddocument... the filesize will change but the file is most probably unuseable

Create a zip on android and upload the zip containing both images
 
Upvote 0
Top