iOS Question Error: The given key was not present in the dictionary

CaptKronos

Active Member
Licensed User
I have noticed other threads discussing this error message but I think my experience is different. It's not a big deal but every 10 to 20 compile requests throws up this error.

An error occured.
The given key was not present in the dictionary.


I then hit F5 again and everything is fine. I am wondering if there is some race condition between the IDE saving a file and the compiler starting?
 

CaptKronos

Active Member
Licensed User
This is it.



givenkeyerror.jpg
 
Upvote 0

CaptKronos

Active Member
Licensed User
It's just done it again.

B4X:
*** no reuse *** 
*** no reuse *** 
*** no reuse *** 
*** no reuse *** 
*** no reuse *** 
Compilation task: 950.4556
Gui: 213
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.SortedDictionary`2.get_Item(TKey key)
   at b6.a(String A_0, bp A_1)
   at f4.a(Boolean A_0, List`1 A_1, dp A_2)
   at f4.a(aw A_0)
   at ed.a(Object A_0)
   at hb.a(Object A_0)
Gui: 106
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
Step to reproduce it on large project:
1. Open some large B4I project. Don't work on small projects.
2. Start app in debug mode.
3. While app running in debug mode, change some code, press CTRL+S and right away (as fast as you can) press F11.
 
Upvote 0

CaptKronos

Active Member
Licensed User
I never use F11 (had to check what it does - Restart), my go to key is F5, so I thought I would follow Pendrush's steps:
1. Yep, large project
2. Yep
3. Pressed F11

And got the following in the IDE log.
B4X:
Gui: 946
System.Exception: Error compiling program.
Error description: An item with the same key has already been added.
Error occurred on line: 39
End Sub
   at cy.a(List`1 A_0, String A_1)
   at a7.b()
   at ed.a(Object A_0)
Compilation task: 2980.3499
Gui: 112
Compilation task: 5555.157
which is slightly different to what I had seen before. At step 3, I didn't do Ctrl+S, just F11, so I am guessing the IDE saved the changes automatically before restarting, hence the Ctrl+S isn't required.
As before, compiling again, straight after receiving the error, everything is back to normal and the project compiles without error.
 
Upvote 0
Top