B4A Library [Tool] Simple Library Compiler - Build libraries without Eclipse

Status
Not open for further replies.

fishwolf

Well-Known Member
Licensed User
Longtime User
I have compile the library sample "FirstLib", tool add library to B4J librarries folder and B4J see this library.

How to i can use the library (single method add)?
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Erel , can you please add a recent menu so we can load last worked-on projects data (Project Folder ,Library Name , and b4ignore ) fields easily ?
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
SLC can be run from the command line. You can create batch files to automate it.
Sorry for asking too much
- Command line mode - You can also run this tool from the command line. It expects two arguments: library name and project path.
Can we pass b4ignore too ?
Also Should we pass it directly like librarycompiler "C:\Users\user\Desktop\libswrapping\twitter4j" "SMMTwitter4J" ?
Thanks in advance
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Can we pass b4ignore too ?
No. But it shouldn't matter. Set it once with all the prefixes required.

Also Should we pass it directly like librarycompiler "C:\Users\user\Desktop\libswrapping\twitter4j" "SMMTwitter4J" ?
The first parameter is the library name and the second if the project path.
 

rbirago

Active Member
Licensed User
Longtime User
I need to develop some wrappers so I started to inspect all the online docs.
First of all I followed the good YouTube tutorial


that explains step-by-step how to create a simple library.

All was ok, but...when I run the B4A test program (the same few lines of the tutorial) it gives me this error:

B4A version: 6.00
Parsing code. (0.00s)
Compiling code. (0.06s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Generating R file. (0.67s)
Compiling debugger engine code. (1.48s)
Compiling generated Java code. (1.68s)
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.processClass(Main.java:598)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:570)
at com.android.dx.command.dexer.Main.access$2(Main.java:546)
at com.android.dx.command.dexer.Main$2.processFileBytes(Main.java:514)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:537)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:449)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:236)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:179)
at com.android.dx.command.Main.main(Main.java:103)
...while parsing anywheresoftware/b4a/sample/FirstLib2.class
1 error; aborting

Any suggestion?

Thank you

P.S: Using B4A 6.0 , Java JDK 1.8.0_91 and platform Android-23
 

DonManfred

Expert
Licensed User
Longtime User

pxpto

Member
Licensed User
Longtime User
I need to compile my library with Java 6.

I've read a post from Erel suggesting to configure B4A to use Java 6 and set "-b4aignore aaa -target 1.6". When I do that I get an error. It's still looking for Java 7:



Could someone help me please?
 

Attachments

  • upload_2016-10-14_9-59-52.png
    20.8 KB · Views: 265

pxpto

Member
Licensed User
Longtime User
Maybe if I try with a previous version of SLC.. Does anyone have SLC 1.01?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…