B4J Question Error during LoadLayout (java.lang.ArrayIndexOutOfBoundsException: arraycopy: length -4 is negative)

peacemaker

Expert
Licensed User
Longtime User
HI, All

I have a complex layout, and before all was OK, but at some point, when the layout gots to be complex - the error is started to occur (non-crashing), at LoadLayout:

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    dd.Initialize
    'The designer script calls the DDD class. A new class instance will be created if needed.
    'In this case we want to create it ourselves as we want to access it in our code.
    xui.RegisterDesignerClass(dd)
    Root.LoadLayout("MainPage")    'error - at this point

What can it be ?
The layout file is attached.
 

Attachments

  • MainPage.zip
    4.3 KB · Views: 76

peacemaker

Expert
Licensed User
Longtime User
Small testing project - yes, always best variant. But this time - it's some internal non-crashing error - is it possible to debug it deeper than ... just trying lo LoadLayout ?
If yes, please, suggest.
I dot see how small project can help here. But i'm trying to prepare.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Ahhh, clear.
Here the test project.

p.s. file below
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Opps, indeed, sorry, cleaned.
 

Attachments

  • debug_proj.zip
    23 KB · Views: 71
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
ProgressBar1. Delete and add it again

Thanks ! But how did you find it ? Just by removing views one by one ? I did not imagine where such error may be...
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Just by removing views one by one
Yes. Save a layout file copy. Remove view, test, if error there copy layout file back, remove another view - rinse and repeat. Or do a binary chop. Remove half the views, then a quarter then finally one by one.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…