Codename one + ZXing -- Build error

93 views
Skip to first unread message

ya...@forwardlogictech.com

unread,
Aug 19, 2013, 3:43:44 PM8/19/13
to codenameone...@googlegroups.com
I've added ZXing library jar files (zxing-javase-2.2.jar, zxing-core-2.3-20130808.043206-5.jar) into my project. Codename one simulator run the app without problems. But when I build to send to the server, the project gave me the compile errors that it cannot find zxing lib reference. I am puzzled why the simulator found zxing library but not the build for the server. Any ideas?

jar:
     [echo] Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
     [echo]        code size and wider device support
     [copy] Copying 3 files to /Users/yab/eclipse-workspace/mytestapp/build/tmp
    [javac] /Users/yab/eclipse-workspace/mytestapp/build.xml:128: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 47 source files to /Users/yab/eclipse-workspace/mytestapp/build/tmp
    [javac] /Users/yab/eclipse-workspace/mytestapp/src/com/yab/mytestapp/model/MemberCard.java:12: package com.google.zxing does not exist
    [javac] import com.google.zxing.BarcodeFormat;

Shai Almog

unread,
Aug 20, 2013, 12:34:23 AM8/20/13
to codenameone...@googlegroups.com, ya...@forwardlogictech.com
You can't just add jar files to the project: http://www.codenameone.com/3/post/2013/07/jaring-and-libraries.html
There is a ZXing demo showing off native integration however its mostly obsolete since we have the codescanner package that already includes zxing.

ya...@forwardlogictech.com

unread,
Aug 20, 2013, 8:58:58 AM8/20/13
to codenameone...@googlegroups.com, ya...@forwardlogictech.com
Hi Shai,

I'm using codescanner for scan. However, I'd like to also write out the barcode image into a file system and for this, I"m using the various Writer classes in ZXing. Is there any barcode writer functionality in codescanner?

Shai Almog

unread,
Aug 20, 2013, 1:09:19 PM8/20/13
to codenameone...@googlegroups.com, ya...@forwardlogictech.com
No, although I would personally recommend using something like the google chart API's which is how we generate our bar codes (simple and portable).
You can embed ZXing (as we do in the ZXing demo) but you will need to use a native interface as explained in the blog post I linked.
Reply all
Reply to author
Forward
0 new messages