I compiled this simple function into a jar library
summ:
Sub Class_Globals
Private mEventName As String 'ignore
Private mCallBack As Object 'ignore
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize (Callback As Object, EventName As String)
mEventName = EventName
mCallBack = Callback
End Sub
Public Sub suma (a As Int, b As Int) As Int
Return a + b
End Sub
after that i used this library
main:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
Private summ1 As summ
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
summ1.Initialize(Me, "summ")
End Sub
Sub Button1_Click
Log(summ1.suma(12,13))
End Sub
I get this error when compiling with the compiled library:
... Compiling generated Java code. Error
B4A line: 29
summ1.Initialize(Me, \
src\b4a\example\main.java:394: error: method _initialize in class summ cannot be applied to given types;
_summ1._initialize(processBA,main.getObject(),"summ");
^
required: summ,BA,Object,String
found: BA,Class<CAP#1>,String
reason: actual and formal argument lists differ in length
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?
Obviously i have my more extensive library but the problem is the same on initialization. Is there a solution here?
Thanks. Yes, it works in the new project. It also works if I remove the library module from the project. I thought that the jar library would be superior to the code.
This is the remains of the experiments, removed. Now everything works, except that when compiling with the jar library I have to remove its code module