Android Question compilation problem with compiled jar library

Jerryk

Member
Licensed User
Longtime User
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?
 

teddybear

Well-Known Member
Licensed User
I don't how you produced Summ_JE.xml, but there seems to be something wrong with it.
B4X:
  <dependsOn>sum_je</dependsOn>
  <dependsOn>aaa</dependsOn>
 
Upvote 0
Top