Bug? Error 'given key was not present in the dictionary' in Designer

Discussion in 'Bugs & wishlist' started by Reproretro, Jun 12, 2015.

  1. Reproretro

    Reproretro Member Licensed User

    I built one very simple app to see how the system works.
    Then I was trying to create a slightly more complicated app in the new version 5. I spent a while working in Designer (no device connected and I don't have emulators), but the designer failed with the above error. I saved it and reloaded it, but all the changes were lost.
    I tried simple layouts, some worked, some failed with the error. E.g. I saved the default listing, opened the Designer and saved that, then added a panel, added a label, added a EditText, clicked on the panel, then clicked on the EditText again, and the error came up. On another occasion it happened when I clicked on the EditText after renaming the panel. But other times I follow this sequence and it doesn't fail, but when it does I seems to be usually when I click on an EditText. Note I have not added any code to the app, nor generated members.
    It makes it difficult to have enough confidence in a system that might lose all my changes, and I noticed this error has been reported for about 4 years.
    Has anyone any ideas on this one?
     
  2. sorex

    sorex Expert Licensed User

    did you install 5.0 or 5.01? 5.01 might have those errors solved.
     
  3. NJDude

    NJDude Expert Licensed User

    I don't think is fixed, I have 5.01 installed and I get that error. It seems you get that error if you delete a view in the designer.
     
  4. Reproretro

    Reproretro Member Licensed User

    My error was always when clicking on something in the designer.
    So that is two sources for the error.
    Every system has bugs, but I am a bit concerned that I am seeing a significant problem - which actually makes development difficult - so early, and as I said before this bug has been reported for at least 4 years.
    Perhaps V4 was more stable?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    The designer was rewritten from scratch in v5.00. There is no relation between any old issue and the new designer.

    The first thing that you need to do is to update to v5.01 it will probably fix this issue.
     
  6. Reproretro

    Reproretro Member Licensed User

    Thank you. Do you have a link for 5.01?
    On the Home page is says 5.00 is the latest version
     
  7. NJDude

    NJDude Expert Licensed User

    I'm running 5.01, installed from scratch and I still see that issue.
     
  8. Reproretro

    Reproretro Member Licensed User

    Found a message on the forum that says the same download link we were sent for V5 download, now downloads V5.01
    So I downloaded it.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Are you able to reproduce it? Can you post the exact steps required?
     
  10. NJDude

    NJDude Expert Licensed User

    Yes, just create a layout, add a couple of views, then remove one, BLAM! nice error.
     
  11. Erel

    Erel Administrator Staff Member Licensed User

  12. NJDude

    NJDude Expert Licensed User

    No, I didn't rename any views, just added 2, deleted one and the error popped up right away.

    I'll do the log thing, give me a few moments.
     
  13. NJDude

    NJDude Expert Licensed User

    Here it is
     

    Attached Files:

    • log.txt
      File size:
      6.7 KB
      Views:
      19
  14. NJDude

    NJDude Expert Licensed User

    By the way, you can also make it happen if you:

    1- Add a label view (or any view)
    2- use the designer script and do something, like e.g. Label1.SetLeftAndRight(0dip, 100%x)
    3- Add another view, then delete it
    4- Error!

    After that point, you won't able to add any views since the "key" error keeps popping up.
     

    Attached Files:

    • log.txt
      File size:
      11.5 KB
      Views:
      10
  15. Erel

    Erel Administrator Staff Member Licensed User

    Thank you. I will check it...
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Can you post a screenshot of the error?

    Are you working with an existing layout file?

    How are you removing the view?
     
  17. NJDude

    NJDude Expert Licensed User

    No, brand new layout, brand new project, and I'm removing the view by selecting it and hitting the DEL key.

    HERE is the screen shot.

    What I did was:

    1- Added the Label
    2- Added a ProgressBar
    3- Added the code to the designer script (label1...)
    4- Selected the Progressbar and hit DEL
    5- Boom.
     
  18. Erel

    Erel Administrator Staff Member Licensed User

    Now I see it. It happens when you delete a view in "designer script mode". This option should have been disabled as the views are locked in that state.

    It will be fixed. Please see whether you encounter this error in "non-designer script mode".
     
  19. NJDude

    NJDude Expert Licensed User

    How's that done?, you mean in code?
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    When you click on the script pane the designer switches into a read-only mode:
    [​IMG]

    It returns to normal mode when you click on the properties grid.
     
Loading...