B4J Question WebView error in executable compilation

Luis Felipe Andrade

Member
Licensed User
Hello I will apreciate your help, I have a project with just only one webview and a button that closes the app.
If I run the app in debug or even in Release mode the program show the web page perfectly, then I create the exe file with "stand-alone package" option as ussualy, but If I try to run the program, the program close instantly no mather the web page I try. I Attach the project, thanks in advance.
weberror.png

Code In Main Page:
#Region Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 600
#End Region
    #MainFormWidth: 1200
    #MainFormHeight: 750
    
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.SetFormStyle ("UNDECORATED")
    MainForm.Show
    'MainForm.Resizable=False
    Dim ps As Screen = fx.PrimaryScreen
    MainForm.WindowLeft = ps.MinX
    MainForm.WindowWidth = ps.MaxX - ps.MinX
    MainForm.WindowTop = ps.MinY
    MainForm.WindowHeight = ps.MaxY - ps.MinY
    Dim PagesManager As B4XPagesManager
    PagesManager.Initialize(MainForm)
End Sub

'Template version: B4J-1.0
#Region Delegates
Sub MainForm_FocusChanged (HasFocus As Boolean)
    B4XPages.Delegate.MainForm_FocusChanged(HasFocus)
End Sub

Sub MainForm_Resize (Width As Double, Height As Double)
    B4XPages.Delegate.MainForm_Resize(Width, Height)
End Sub

Sub MainForm_Closed
    B4XPages.Delegate.MainForm_Closed
End Sub

Sub MainForm_CloseRequest (EventData As Event)
    B4XPages.Delegate.MainForm_CloseRequest(EventData)
End Sub

Public Sub MainForm_IconifiedChanged (Iconified As Boolean)
    B4XPages.Delegate.MainForm_IconifiedChanged(Iconified)
End Sub
#End Region
Code In Bx4MainPAge:
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region

'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip

Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private WebView1 As WebView
    Dim fx As JFX
    Dim timer1 As Timer
End Sub

Public Sub Initialize
    B4XPages.GetManager.LogEvents = True
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    timer1.Initialize("Send", 1000)
    timer1.Enabled=True
    WebView1.Top=0
    WebView1.Left=0
    
End Sub
Sub Send_tick
    timer1.Enabled=False
    Dim url As String
    Dim data1 As String
    data1=fx.Clipboard.GetString
    '''''url="http://www.mywebsite.com.mx/concierge/map.html?" & data1
    url="http://www.hbo.com"
    WebView1.LoadUrl (url)
    
    
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
    ExitApplication
    
End Sub
 
Top