B4J Question [SOLVED??]Building a standalone package issue

Daren463

Member
Licensed User
Longtime User
I am using B4J 9.3 and Java 11. My B4XPage project contains 7 pages, the Main code module, and 2 class modules, using B4XPages, JCore, jFX, and XUI Views . The code run properly in Debug and Release modes with no issue.

The built project builds with no issues and starts up and loads the main page. When I try and load the FileChooser it crashes or if I try and open the next page the page opens and it appears it did not load the layout.

I a unsure how to trouble shoot this issue, any suggestions?
 
Last edited:

Daren463

Member
Licensed User
Longtime User
I found an issue with the page not loading the layout. I can now get one more page deeper into the structure until it crashes.

I have noticed that if I try and open a second file the filechooser crashes when the ShowOpen is called again.
 
Upvote 0

Daren463

Member
Licensed User
Longtime User
I found the issues with the filechooser. I redefined my working directory to a non-existing folder. Now for the open page issue.

The main page loads fine. The CaracterMainPage loads fine. The program crashes when I try and open a Hero Page. This crash only occurs when I make this a standalone app.

The pages are defined in the MainPage code.

B4XMainPage:
    B4XPages.AddPage("Hero1Layout",H1Page)
    B4XPages.AddPage("Hero2Layout",H2Page)
    B4XPages.AddPage("Hero3Layout",H3Page)
    B4XPages.AddPage("Hero4Layout",H4Page)
    B4XPages.AddPage("Hero5Layout",H5Page)
    H1Page.Initialize
    H2Page.Initialize
    H3Page.Initialize
    H4Page.Initialize
    H5Page.Initialize






This is the code below is the page calls:


CharacterMainPage:
     Case "View Hero Page"   
                Select id
                    Case 0
                        B4XPages.ShowPage("Hero1Layout")
                    Case 1
                        B4XPages.ShowPage("Hero2Layout")
                    Case 2
                        B4XPages.ShowPage("Hero3Layout")
                    Case 3
                        B4XPages.ShowPage("Hero4Layout")
                    Case 4
                        B4XPages.ShowPage("Hero5Layout")
                End Select
 
Upvote 0

Daren463

Member
Licensed User
Longtime User
I have found the program dose not crash if I do not load the layout to the root.

B4X:
Root.LoadLayout("Hero1Lahout")
 
Upvote 0

Daren463

Member
Licensed User
Longtime User
I have a several images that are updated in the B4XPage_Appear. I have noted that if I place a sleep(0) after the second imageview setbitmap command the page will load. Not all of the other views will load.
 
Upvote 0

Daren463

Member
Licensed User
Longtime User
Solved???
I had two png files that was added to the layout in the designer. After I set the imageview to a null the system stopped crashing. The files open fine on any other software so I dont have a clue why.
 
Last edited:
Upvote 0
Top