Android Question Compiler error message

Uitenhage

Member
Licensed User
Longtime User
I am converting a B4A app to B4XPages. After converting a few screens without a problem, I added a new set of screens/modules and the compiler gives:

B4A Version: 11.20
Parsing code. Error
Specified argument was out of the range of valid values.
Parameter name: index


I started B4A with the -log parameter and this is the log it produced:
Logfile:
Build modules tree: 0
B4A version: 11.20
.Net version: 4.0.30319.42000
Ini folder: C:\Users\xxxxl\AppData\Roaming\Anywhere Software\Basic4android
UDP server: 192.168.1.110, broadcast: 192.168.1.255
Global Java version: 11
Gui: 1003
Build modules tree: 0
Gui: 522
ExitCode: 0
Output:

Error:

optimized dexer: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at h9.get_Item(a key)
   at h2.ax()
   at l.c()
Build modules tree: 81
Build modules tree: 0
*** no reuse ***
Build modules tree: 0
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
Gui: 375
Compilation task: 142.3777
opt: waiting for connection on port: 14432
opt: *************************
Gui: 190
Compilation task: 342.8056
opt: waiting for latch.

I read several other threads about this error and I have checked for empty modules or ones named 'a' or 'm'. I added (and later removed) Process_Globals with no effect.

Any ideas would be greatly appreciated.
 

Uitenhage

Member
Licensed User
Longtime User
Looks like you are compiling a release obfuscated version. Try just with release and the error might be more meaningful. Don't you get an error shown in the compilation window in B4A?
I'm trying Debug mode but I just checked and Release and Release(obfuscated) yield the same results.
Screenshot 2022-02-07 121704.png


Nothing in the Logs panel.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Nothing in the Logs panel.
There won't be - it's a compile error. While your -log output looks like a dexer error the compile pane makes it look like it's a first pass parsing error.very odd. However it must be something in whatever you have added - you will just have to take stuff out till it works again then add things back until it doesn't to find the culprit. Looks like you managed to do something that escapes the normal error reporting.
 
Upvote 0

Uitenhage

Member
Licensed User
Longtime User
There won't be - it's a compile error. While your -log output looks like a dexer error the compile pane makes it look like it's a first pass parsing error.very odd. However it must be something in whatever you have added - you will just have to take stuff out till it works again then add things back until it doesn't to find the culprit. Looks like you managed to do something that escapes the normal error reporting.
Not the answer I was hoping for but really the one I expected.

Thank you for your time.
 
Upvote 0

Uitenhage

Member
Licensed User
Longtime User
Not the answer I was hoping for but really the one I expected.

Thank you for your time.
I really would love an explanation. If I rename a class module named iFacility to Facility (and fix the references to it) the app compiles perfectly! I fiddled with a few other classes similarly but none of them behaved like this.
 
Last edited:
Upvote 0

agraham

Expert
Licensed User
Longtime User
rename a class module named iFacility to Facility (and fix the references to it) the app compiles perfectly!
I can't reproduce that so there may be a bit more to it than just the name, although that is obviously the triggering factor. That's one for Erel I think. There's a hole in the error protection somewhere.
 
Upvote 0

Spavlyuk

Active Member
Licensed User
Did you have any variables named iFacility? Sometimes there can be issues if the name of a variable is the same as that of a class or activity.
 
Upvote 0

Uitenhage

Member
Licensed User
Longtime User
No, I commented out all the #IgnoreWarnings directives looking for exactly that kind of thing. That shows up in the Logs pane as a Warning #30.
 
Upvote 0
Top