I am trying to wrap my 1st lib. It is https://github.com/JakeWharton/ProcessPhoenix
I am using the Simple library compiler and have run into this error. I have included my project.
The forum is correct i guess.
But the code you are trying is not what i would expect to see as code.
The java you are editing extends an activity. So it should be as is but you need to write a wrapper for this to call the methods.
Additional all "third-party" code should be expluded when compiling with slc. So i was extecting the wrapperclass in another package.
In my libs it is always de.donmanfred. code from com.google for example i exclude in slc with com.google in the b4a-ignore-field.
de.donmanfred.thisisawrapper,java for example will be used to wrap com.google.thisisthecodefromgoogle.java
OK, so I think I am starting to understand. What I need is:
1. Compiled code of the class I want to wrap. (A JAR file)
2. A class I create that has the wrapper code in it.
you need to add the "original" sources (java) to your project.
Say you add com.google.somewhat then you need to add com.google in b4a ignore.
for this here: you are using anwheresoftware.b4a.objects as packagename
you added com.jakewharton.somewhat
You need to add com.jakewharton to b4a ignore.
SLC will read the files from anwheresoftware.b4a.objects.*.java
it will find your wrapper java. It included the com.jakewharton code then. SLC will IGNORE them BUT put them into the resulting jar
Yep, I had the dependson directive when I thought I had to compile the JAR by itself.
I removed it and I can build my app fine now. THANKS!!!!!!!!!!!!!!
I did run into this though when trying to invoke the lib. hhhhmmmm. But I wrapped and built it!!!!!
Thanks for all your help @DonManfred I will attempt to wrap more libs in the future.
In the end I replaced it with.
B4X:
Dim r, r2 As Reflector
r.Target = r.GetActivity
r.Target = r.RunMethod("getApplicationContext")
r2.Target = r.RunMethod("getPackageManager")
Dim I As Intent = r2.RunMethod2("getLaunchIntentForPackage", r.RunMethod("getPackageName"), "java.lang.String" )
r.Target = I
r.RunMethod2("addFlags", 67108864, "java.lang.int")
StartActivity(I)