Android Question Cannot find zbar.jar

Status
Not open for further replies.

Frank Cazabon

Member
Licensed User
Longtime User
Hi,
I have not done any b4a stuff in a while so this may just be because I am rusty but...

I am trying to run the sample b4aZbarBarcodeScanner from https://www.b4x.com/android/forum/t...feb-2016-new-library-files-in-post-105.60155/

I have put the abdroid-support-v4.jar and core-3.1.0.jar n my Additional Libraries folder.

When I try to run it I get this message:

B4A version: 5.50
Parsing code. (0.00s)
Compiling code. Error
Error compiling program.
Error description: Missing parameter.
Occurred on line: 66
zb1.startScanner

So I changed the line to this:

zb1.startScanner(0)

Then when I run it I get this:

B4A version: 5.50
Parsing code. (0.00s)
Compiling code. (0.04s)
Compiling layouts code. (0.01s)
Generating R file. (0.05s)
Compiling debugger engine code. (0.69s)
Compiling generated Java code. Error
Cannot find: C:\Program Files (x86)\Anywhere Software\B4A 5\libraries\zbar.jar

Note that this is using B4A 5.50. Maybe this is a version issue?
 

Johan Schoeman

Expert
Licensed User
Longtime User
Upvote 0

Frank Cazabon

Member
Licensed User
Longtime User
Not sure where zbar.jar comes from however v5.50 is quite old now and it will be difficult to get it working with new libraries.
Thanks Erel,
is upgrading from old versions to the newest versions a straightforward thing? I have an app in version 4.
 
Upvote 0

Frank Cazabon

Member
Licensed User
Longtime User
ZBAR is in this post (there is a link to download the lib files from as they are too big to upload to the forum).
https://www.b4x.com/android/forum/t...de-scanner-that-is-100-embedded-in-b4a.63794/

Your link above is to the ZXING project.

Rgds

JS

Thanks Johan,
I downloaded the zbarbarcodescannerlibfiles.zip and extracted the files to my Additional Libraries folder but I still get the same error. I have tried both the b4aZbarBarcodeScanner sample and the b4ZXingStandAlone. I can't get either to work.

The latter compiles, installs on my phone and then just closes.

Can either of these projects work with B4A 5.5 or 4.0? Or do I need to upgrade to the latest version of b4A?

Or maybe you can point me to the best place o start with these samples as I have been trying to follow the threads on these and there appear to be various versions of files that need downloading and I'm not sure I've got all the files and all the correct versions.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Can either of these projects work with B4A 5.5 or 4.0?
It is possible that it does not work.

Especially newer libraries does depend on newer B4A Versions.

Both your versions are quite old. I suggest to get an Update to 9.5
 
Upvote 0

Frank Cazabon

Member
Licensed User
Longtime User
It is possible that it does not work.

Especially newer libraries does depend on newer B4A Versions.

Both your versions are quite old. I suggest to get an Update to 9.5
Thanks, is the upgrade a straightforward thing? Any documentation on the process available here?
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
Thanks Johan,
I downloaded the zbarbarcodescannerlibfiles.zip and extracted the files to my Additional Libraries folder but I still get the same error. I have tried both the b4aZbarBarcodeScanner sample and the b4ZXingStandAlone. I can't get either to work.

The latter compiles, installs on my phone and then just closes.

Can either of these projects work with B4A 5.5 or 4.0? Or do I need to upgrade to the latest version of b4A?

Or maybe you can point me to the best place o start with these samples as I have been trying to follow the threads on these and there appear to be various versions of files that need downloading and I'm not sure I've got all the files and all the correct versions.
Frank, not sure /cannot remember what B4A version was the latest version in February 2016 when I started wrapping both the ZBAR and ZXING versions of that Github posting. But both B4A projects are still working today using B4A v9.50
 
Upvote 0

Frank Cazabon

Member
Licensed User
Longtime User
Frank, not sure /cannot remember what B4A version was the latest version in February 2016 when I started wrapping both the ZBAR and ZXING versions of that Github posting. But both B4A projects are still working today using B4A v9.50
Thanks, I'm trying to install the trial version of 9.5 and go through your sample but getting an error there too:

B4X:
Logger connected to:  motorola Moto G (5) Plus
--------- beginning of system
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 38 (Main)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at JHS.ZbarBarcodeScanner.main._activity_create(main.java:389)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at JHS.ZbarBarcodeScanner.main.afterFirstLayout(main.java:104)
    at JHS.ZbarBarcodeScanner.main.access$000(main.java:17)
    at JHS.ZbarBarcodeScanner.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6626)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 18 more
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/JHS.ZbarBarcodeScanner-RAQmSEnnwnQVy3c3pxTMdg==/base.apk"],nativeLibraryDirectories=[/data/app/JHS.ZbarBarcodeScanner-RAQmSEnnwnQVy3c3pxTMdg==/lib/arm, /system/lib, /system/vendor/lib]]] couldn't find "libiconv.so"
    at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
    at java.lang.System.loadLibrary(System.java:1657)
    at main.java.me.dm7.barcodescanner.zbar.ZBarScannerView.<clinit>(ZBarScannerView.java:32)
    at zbarbarcodescannerwrapper.zbarBarcodeScannerWrapper._initialize(zbarBarcodeScannerWrapper.java:107)
    ... 21 more
** Activity (main) Resume **
 
Upvote 0

fij

New Member
Licensed User
Longtime User
Hi,
I have not done any b4a stuff in a while so this may just be because I am rusty but...

I am trying to run the sample b4aZbarBarcodeScanner from https://www.b4x.com/android/forum/t...feb-2016-new-library-files-in-post-105.60155/

I have put the abdroid-support-v4.jar and core-3.1.0.jar n my Additional Libraries folder.

When I try to run it I get this message:

B4A version: 5.50
Parsing code. (0.00s)
Compiling code. Error
Error compiling program.
Error description: Missing parameter.
Occurred on line: 66
zb1.startScanner

So I changed the line to this:

zb1.startScanner(0)

Then when I run it I get this:

B4A version: 5.50
Parsing code. (0.00s)
Compiling code. (0.04s)
Compiling layouts code. (0.01s)
Generating R file. (0.05s)
Compiling debugger engine code. (0.69s)
Compiling generated Java code. Error
Cannot find: C:\Program Files (x86)\Anywhere Software\B4A 5\libraries\zbar.jar

Note that this is using B4A 5.50. Maybe this is a version issue?


Hi - I am on 9.80 and followed these same steps. I am getting the exact same error as well. Won't compile as it cannot fine zbar.jar.
 
Upvote 0
Status
Not open for further replies.
Top