D Declan Well-Known Member Licensed User Longtime User Dec 18, 2016 #1 When I run my app in "Debug" all is OK. But when I run under "Release" I get the following error: Code: ** Service (starter) Create ** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** Day of Week: Sunday ** Activity (main) Resume ** Current Date: 18/12/2016 New Selected Date: 01/12/2016 java.lang.Exception: Sub was not found. at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175) at anywheresoftware.b4a.keywords.Common$5.run(Common.java:996) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5631) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
When I run my app in "Debug" all is OK. But when I run under "Release" I get the following error: Code: ** Service (starter) Create ** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** Day of Week: Sunday ** Activity (main) Resume ** Current Date: 18/12/2016 New Selected Date: 01/12/2016 java.lang.Exception: Sub was not found. at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175) at anywheresoftware.b4a.keywords.Common$5.run(Common.java:996) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5631) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
Erel B4X founder Staff member Licensed User Longtime User Dec 18, 2016 #2 Based on the error message you are calling CallSubDelayed with an empty sub parameter. Upvote 0
D Declan Well-Known Member Licensed User Longtime User Dec 18, 2016 #3 I am calling the Sub from two Subs in the app. The first Call from: Sub Activity_Create(FirstTime As Boolean) Code: GetHomework(MyCalDate) This works no problem. The second Call from: Sub AnotherDatePicker1_Closed (Cancelled As Boolean, Date As Long) Code: If MyCalDateNew <> MyCalDate Then CallSubDelayed(Me, GetEvents(MyCalDateNew)) CallSubDelayed(Me, GetSports(MyCalDateNew)) CallSubDelayed(Me, GetHomework(MyCalDateNew)) <------------- MyCalDate = MyCalDateNew End If Gives me the error: Code: LogCat connected to: 0123456789ABCDEF --------- beginning of main --------- beginning of system ** Service (starter) Create ** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** Day of Week: Sunday ** Activity (main) Resume ** Current Date: 18/12/2016 New Selected Date: 01/12/2016 java.lang.Exception: Sub was not found. at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175) at anywheresoftware.b4a.keywords.Common$5.run(Common.java:996) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5631) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) The sub parameter (MyCalDateNew) has valid data. Strange that the first call does not raise the error? Upvote 0
I am calling the Sub from two Subs in the app. The first Call from: Sub Activity_Create(FirstTime As Boolean) Code: GetHomework(MyCalDate) This works no problem. The second Call from: Sub AnotherDatePicker1_Closed (Cancelled As Boolean, Date As Long) Code: If MyCalDateNew <> MyCalDate Then CallSubDelayed(Me, GetEvents(MyCalDateNew)) CallSubDelayed(Me, GetSports(MyCalDateNew)) CallSubDelayed(Me, GetHomework(MyCalDateNew)) <------------- MyCalDate = MyCalDateNew End If Gives me the error: Code: LogCat connected to: 0123456789ABCDEF --------- beginning of main --------- beginning of system ** Service (starter) Create ** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** Day of Week: Sunday ** Activity (main) Resume ** Current Date: 18/12/2016 New Selected Date: 01/12/2016 java.lang.Exception: Sub was not found. at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175) at anywheresoftware.b4a.keywords.Common$5.run(Common.java:996) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5631) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) The sub parameter (MyCalDateNew) has valid data. Strange that the first call does not raise the error?
stevel05 Expert Licensed User Longtime User Dec 18, 2016 #4 Is the GetHomeWork sub expecting the parameter to be have Long type? Upvote 0
stevel05 Expert Licensed User Longtime User Dec 18, 2016 #5 Ignore that, to pass parameters, you should be using CallSubDelayed2 Upvote 0
LucaMs Expert Licensed User Longtime User Dec 18, 2016 #6 stevel05 said: Ignore that, to pass parameters, you should be using CallSubDelayed2 Click to expand... Right, Steve. Code: CallSubDelayed2(Me, "GetEvents", MyCalDateNew) CallSubDelayed2(Me, "GetSports", MyCalDateNew) CallSubDelayed2(Me, "GetHomework", MyCalDateNew) Upvote 0
stevel05 said: Ignore that, to pass parameters, you should be using CallSubDelayed2 Click to expand... Right, Steve. Code: CallSubDelayed2(Me, "GetEvents", MyCalDateNew) CallSubDelayed2(Me, "GetSports", MyCalDateNew) CallSubDelayed2(Me, "GetHomework", MyCalDateNew)