Android Question Errror creating a library

mrjaw

Active Member
Licensed User
Longtime User
Hi! I am using the example here to create my own lib with eclipse. Everything was fine but when I try to compile the program with this lib I get this error
B4X:
B4A version: 6.50

Parsing code.  (0.00s)

Compiling code.  (0.27s)

Compiling layouts code.  (0.05s)

Organizing libraries.  (0.01s)

Generating R file.  (0.40s)

Compiling debugger engine code.  (1.46s)

Compiling generated Java code.  (1.53s)

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 com/jq/serial/SerialPort2.class

1 error; aborting

Any clues??
 

mrjaw

Active Member
Licensed User
Longtime User
Now , I get this ::

B4X:
B4A version: 5.50
Parsing code.  (0.00s)
Compiling code.  (0.17s)
Compiling layouts code.  (0.02s)
Generating R file.  Error
AndroidManifest.xml:16: error: Error: No resource found that matches the given name (at 'theme' with value '@android:style/Theme.Holo').
 
Upvote 0

mrjaw

Active Member
Licensed User
Longtime User
I am seeing a few comments here and change my SDK to compile with JDK7
B4X:
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:704)
   at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
   at com.android.dx.command.dexer.Main.access$300(Main.java:83)
   at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
   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:632)
   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
   at com.android.dx.command.dexer.Main.run(Main.java:246)
   at com.android.dx.command.dexer.Main.main(Main.java:215)
   at com.android.dx.command.Main.main(Main.java:106)
...while parsing com/jq/serial/SerialPort2.class
1 error; aborting
but the problem persist , any help or cluee?

Thks!
 
Upvote 0

mrjaw

Active Member
Licensed User
Longtime User
You need to change to Java 7 in the Java code or you must need to change in B4A to 7 too?. I changed to Java 7 in B4A too and I got this error

B4A :: Java 7
Eclipse:: Java 7

B4X:
B4A version: 5.50
Parsing code.  (0.00s)
Compiling code.  (0.09s)
Compiling layouts code.  (0.00s)
Generating R file.  (0.06s)
Compiling debugger engine code.  Error
Error: Could not find or load main class com.sun.tools.javac.Main
 
Upvote 0

mrjaw

Active Member
Licensed User
Longtime User
OK, I use Java8 with B4A but my problem persist. I am compiling the java code in eclipse with JDK 7
B4X:
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:704)
   at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
   at com.android.dx.command.dexer.Main.access$300(Main.java:83)
   at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
   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:632)
   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
   at com.android.dx.command.dexer.Main.run(Main.java:246)
   at com.android.dx.command.dexer.Main.main(Main.java:215)
   at com.android.dx.command.Main.main(Main.java:106)
...while parsing com/jq/serial/SerialPort2.class
1 error; aborting
 
Upvote 0
Top