Bug? Debugger (Rapid) Mode "array type"

mariolu

Member
Licensed User
Longtime User
When you have the following array variables declared for CellTypeface

Dim CellTypeface(1) As Typeface

CellTypeface(0) = Typeface.DEFAULT_BOLD
CellTypeface(1) = Typeface.DEFAULT

The debugger in Rapid Mode does not load the code on the device, it gives you the following error in the log

"java.lang.IllegalArgumentException: Wrong array type"

I get no error when its compiled in legacy mode nor do I get a compile error when I test compiling!!!

I am assuming the code is written correctly!!

Please advise!!!
 

stevel05

Expert
Licensed User
Longtime User
You should get an array index out of bounds exception as the Dim statement should be
B4X:
Dim CellTypeface(2) As Typeface
to hold two elements. Apart from that I've just tried it in debug and release modes and don't get an error.

Are you sure the error is on that line?
 

mariolu

Member
Licensed User
Longtime User
You should get an array index out of bounds exception as the Dim statement should be
B4X:
Dim CellTypeface(2) As Typeface
to hold two elements. Apart from that I've just tried it in debug and release modes and don't get an error.

Are you sure the error is on that line?


Sorry the code was as follows:

Dim CellTypeface(2) As Typeface (correction)
CellTypeface(0) = Typeface.DEFAULT_BOLD
CellTypeface(1) = Typeface.DEFAULT

If I comment line 2 and 3 it compiles OK, once I uncomment it, I get the error!!!

Debug rapid mode it errors out, legacy mode is OK!!!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is indeed a bug in the rapid debugger. It will be fixed for the next update. It is not really related to the comment but rather to the sub being "dirty" after you modified it.

You can workaround this in two ways:
- Tools -> Clean Project. This will cause the full project to be deployed and in most cases will solve this issue.
- Use a temporary variable:
B4X:
Dim t As Typeface = Typeface.DEFAULT_BOLD
CellTypeFace(1) = t
 
Top