Android Question "The given key was not present in the dictionary" error

aedwall

Active Member
Licensed User
Longtime User
What the heck is this and how do I fix it?

What key? What dictionary?

I have a working .b4A project using v13.40. I make some changes, in order to get rid of a problematic dialog2 library and instead use the dialog library. I try to load my new .b4A file and all I see is this error message, along with a start project with none of my files or libraries enabled (the new "project" says "#ApplicationLabel: B4A Example". They are visible, but all grayed out. No matter what I have tried, I can't get .b4A to show my code - it just shows a new example project.

Can anyone shed light on this? I am at the end of my rope. Thank you.
 

aeric

Expert
Licensed User
Longtime User
It seems your .b4a file is corrupted.
You need to
1. create a new project
2. open the b4a file using notepad
3. move your old code to the new b4a file
4. replace the old file with the new b4a file


If you have backup, just use the backup file.
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
I have done that and it makes no difference - still fails. I don't see how the file is corrupted when I can read it in Notepad and there is no spot in the code that has "funny" characters. What kind of corruption do you suspect? But I will try one more time, just for luck. Thank you.

UPDATE: The trouble with that is I don't have a choice to open a new project that is NOT b4xPages. Yeah, I know that's the standard these days, but this project was done before b4xPages came along. And I don't feel like the hassle of dealing with all that after all the hassle I have already had. Maybe I will feel different after a night's sleep. This has sucked the life out of me today.

UPDATE: >> If you have backup, just use the backup file.

I have loads of backups and none of them work. I find the b4A editor and IDE unreliable. There are spooky times when the IDE changes code on me and makes various lines of code "jumbled". I have written about this before, but I can't reproduce the problem in any consistent way. All I know is that b4A can't be trusted, hence why I make tons of backups as I make code modifications.
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
I don't see how the file is corrupted when I can read it in Notepad
Corrupted means one of the keys may have been missing that is part of the project file format. The IDE unable to parse it correctly.
You still can read it using Notepad.

The keys includes Build1, File1, File2, ..., FileGroup1, FileGroup2, ..., Library1, Library2, ..., ManifestCode, Module1, Module2, ..., NumberOfFiles,
NumberOfLibraries, NumberOfModules.
Example, if this file has NumberOfFiles=3 but it only has File1 and File2 then File3 is missing. This is a "corrupted" file.
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
Corrupted means one of the keys may have been missing that is part of the project file format. The IDE unable to parse it correctly.
You still can read it using Notepad.

The keys includes Build1, File1, File2, ..., FileGroup1, FileGroup2, ..., Library1, Library2, ..., ManifestCode, Module1, Module2, ..., NumberOfFiles,
NumberOfLibraries, NumberOfModules.
Example, if this file has NumberOfFiles=3 but it only has File1 and File2 then File3 is missing. This is a "corrupted" file.
Thank you for that explanation. Seems like I could manually check that myself. Unless there are invisible keys as well. Yet if visible keys are missing, then copying the file to a new project would not solve anything.
 
Upvote 0
Top