Android Question B4XPage_Created signature does not match expected signature

I had a B4xpages project which contained a custom view class and was later compiled into a b4a library. When I tested the custom view of the library in a new project, the app crashed on launch with information like "B4XPage_Created signature does not match expected signature."
The full error message is like this:

error message:
Error occurred on line: 359 (B4XPagesManager)
java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1087)
    at b4a.testLib.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:1068)
    at b4a.testLib.b4xpagesmanager._showpage(b4xpagesmanager.java:425)
    at b4a.testLib.b4xpagesmanager._addpage(b4xpagesmanager.java:245)
    at b4a.testLib.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:259)
    at b4a.testLib.b4xpagesmanager._initialize(b4xpagesmanager.java:165)
    at b4a.testLib.main._activity_create(main.java:415)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
    at b4a.testLib.main.afterFirstLayout(main.java:105)
    at b4a.testLib.main.access$000(main.java:17)
    at b4a.testLib.main$WaitForLayout.run(main.java:83)
    at android.os.Handler.handleCallback(Handler.java:955)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:228)
    at android.app.ActivityThread.main(ActivityThread.java:9105)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:614)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1129)
Caused by: java.lang.RuntimeException: java.lang.Exception: Sub B4XPage_Created signature does not match expected signature.
    at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
    at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
    ... 24 more
Caused by: java.lang.Exception: Sub B4XPage_Created signature does not match expected signature.
    at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:321)
    ... 25 more
** Activity (main) Resume **

having no clue where I wrote the code wrong:(. Or is it a bug?
 

Attachments

  • FirstLib.zip
    12.6 KB · Views: 101
  • FirstLib.jar
    37.1 KB · Views: 100
  • FirstLib.xml
    9 KB · Views: 108
Hi, Erel, I did what you said. It finally worked! Thank you

After some testing, either of these 2 ways solved the problem.

1. Compiling the source code into a b4xlib instead, as suggested.
2. Creating a new default b4a project instead of a b4xpage project to implement the custom view class and compile the project.
 
Upvote 0
Top