PdeG Member Licensed User Longtime User Nov 11, 2020 #1 I get this error when running my app in release mode, debug mode runs without error B4X: Copy java.lang.Exception: Sub timerdevice_tick was not found. at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219) at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7397) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935) but the sub exists in the class i'm using B4X: Copy Sub Class_Globals Public TimeGetDevice As Timer End Sub Public Sub Initialize(callingActivity As String) act = callingActivity TimeGetDevice.Initialize("timerDevice", 12000) End Sub public Sub timerDevice_Tick starter.timeElapsed = True End Sub Something i'm overlooking? Regards, Peter
I get this error when running my app in release mode, debug mode runs without error B4X: Copy java.lang.Exception: Sub timerdevice_tick was not found. at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219) at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7397) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935) but the sub exists in the class i'm using B4X: Copy Sub Class_Globals Public TimeGetDevice As Timer End Sub Public Sub Initialize(callingActivity As String) act = callingActivity TimeGetDevice.Initialize("timerDevice", 12000) End Sub public Sub timerDevice_Tick starter.timeElapsed = True End Sub Something i'm overlooking? Regards, Peter
agraham Expert Licensed User Longtime User Nov 11, 2020 #2 Try timerDevice.Enabled = True Sorry too quick to read, too slow to understand Upvote 0
B Brian Dean Well-Known Member Licensed User Longtime User Nov 11, 2020 #3 Something i'm overlooking? Click to expand... The general advice is to declare timers in Process Globals. If you declare them elsewhere then you risk creating multiple copies and getting the sort of situation that you describe. Not sure if this is your problem without seeing more code. Upvote 0
Something i'm overlooking? Click to expand... The general advice is to declare timers in Process Globals. If you declare them elsewhere then you risk creating multiple copies and getting the sort of situation that you describe. Not sure if this is your problem without seeing more code.
Erel B4X founder Staff member Licensed User Longtime User Nov 12, 2020 #4 Strange... Can you upload the project? Upvote 0
PdeG Member Licensed User Longtime User Nov 13, 2020 #5 Sorry for the late response, I think something was corrupted in my project folder, I deleted the project and did a fresh clone from GitHub and the error disappeared. Thanks for the replies. Regards, Peter Upvote 0
Sorry for the late response, I think something was corrupted in my project folder, I deleted the project and did a fresh clone from GitHub and the error disappeared. Thanks for the replies. Regards, Peter