Android Question Error when compiling in release mode.

svein berg

Licensed User
Longtime User
I have an Arduino IDE which is sending a log (String) every second by WIFI set up as an AP.
I have made the following in Starter service;
Sub Process_Globals
Public sok As Socket
End Sub

Sub Service_Create
sok.Connect( "",8080,2000)
End Sub

public Sub SOKK_Connected (Successful As Boolean)
End Sub

Then in Main I have;

Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private l2 As B4XView
Private tmr As Timer
End Sub

Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
tmr.Initialize("tmr", 1000)
tmr.Enabled =True
end sub

Sub tmr_Tick
If Starter.sok.Connected Then
Dim tr As TextReader
Dim sb As StringBuilder
sb.Append(tr.ReadLine )
l2.Text= sb.ToString
l2.Text="No Connect"
End If
End Sub

Compiling in debug with my Samsung Galaxy A52 USB connected it works, and my textbox (L2) is updated every second.
I then tried to compile in release mode, and get pages of errors.
The first line says;
b4xmainpage_tmr_tick(Java line 153)
at android.os.stricktmode$androidblockguardpolicy.onnetwork(

Running B4A 11.8 on windows 10.
I'm new to B4A so any help would bee very kind.

By the way;
Your Paypal donation do not work..

best regards svein