Android Question Can't get MobileVisionBarcodeScanner to work

Status
Not open for further replies.

CStorSupport

Member
Licensed User
Hello All,

I've tried different projects from the forum but landed on this one:
https://www.b4x.com/android/forum/threads/mobilevisionbarcodescanner.72232/
Thank you, Johan Schoeman!

I followed almost every post (skipped the v29 steps, thank you DonManfred).

Ran into several problems and solved most.

-Followed steps 1-4 from this page: https://www.b4x.com/b4a.html
(it needs to be updated: step 3 at "C:\Program Files\Java\jdk1.8.0_211\bin\javac.exe" should read C:\Program Files\Java\jdk1.8.0_241\bin\javac.exe)
-Updated my Manifest targetsdk to 28.
-Used SDK Manager to install several of Googles mavens.
-Using a not-too-old Moto Z with Android 8.0.0, ODN27.76-12-30-8-1, patch level Aug 1, 2018, 32 gig using 24 of it
-Installed B4A Bridge 2.61, connected easily.

And still, when I run in debug, it crashes.

Below are images of my settings and the log results.

My complete project including libraries and other jars can be downloaded from
http://www.c-stor.com/CStorSupport/my MobileVisionBarcodeScanner project.zip

Thank you in advance for your help!

Bryan
Libraries Manager.pngManifest Editor.pngPaths Configuration.pngproject and folder structure.png

log result.png
 

CStorSupport

Member
Licensed User
Per Erel's request:

Logger connected to: motorola XT1635-01
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Lxyz/belvi/mobilevisionbarcodesample/MainActivity;
at mvbarcodescannerwrapper.mvbarcodescannerWrapper.Initialize(mvbarcodescannerWrapper.java:74)
at JHS.MVBarcodeScanner.main._activity_create(main.java:387)
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.MVBarcodeScanner.main.afterFirstLayout(main.java:104)
at JHS.MVBarcodeScanner.main.access$000(main.java:17)
at JHS.MVBarcodeScanner.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
Caused by: java.lang.ClassNotFoundException: xyz.belvi.mobilevisionbarcodesample.MainActivity
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/AppCompatActivity;
... 18 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.AppCompatActivity" on path: DexPathList[[zip file "/data/app/JHS.MVBarcodeScanner-jjVq4GBrytvuCDSBG8_CKg==/base.apk"],nativeLibraryDirectories=[/data/app/JHS.MVBarcodeScanner-jjVq4GBrytvuCDSBG8_CKg==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more
** Activity (main) Resume **


But regarding AppCompat I don't know what to do:

appcompat.png
 

CStorSupport

Member
Licensed User
Copied these files to my Additional Libraries folder:
03/23/2020 08:42 AM 87,140 AppCompat.aar
03/23/2020 08:42 AM 86,992 AppCompat.androidx.aar
03/23/2020 08:42 AM 22 AppCompat.jar
03/23/2020 08:42 AM 212,443 AppCompat.xml


These are installed:
Android Support Repository.png


If I need to 'Deinstall' 27.0.1, I haven't figured out how to do that . Help on this would be appreciated.

My Libraries:
Libraries Manager.png


The result:
It crashes.
But on the first run, nothing shows in the Logs. Not a single line.
On subsequent runs:
Logger connected to: motorola XT1635-01
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Lxyz/belvi/mobilevisionbarcodesample/MainActivity;
at mvbarcodescannerwrapper.mvbarcodescannerWrapper.Initialize(mvbarcodescannerWrapper.java:74)
at JHS.MVBarcodeScanner.main._activity_create(main.java:387)
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.MVBarcodeScanner.main.afterFirstLayout(main.java:104)
at JHS.MVBarcodeScanner.main.access$000(main.java:17)
at JHS.MVBarcodeScanner.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
Caused by: java.lang.ClassNotFoundException: xyz.belvi.mobilevisionbarcodesample.MainActivity
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/AppCompatActivity;
... 18 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.AppCompatActivity" on path: DexPathList[[zip file "/data/app/JHS.MVBarcodeScanner-_xprUJ82HumfnZj-aKydYA==/base.apk"],nativeLibraryDirectories=[/data/app/JHS.MVBarcodeScanner-_xprUJ82HumfnZj-aKydYA==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Lxyz/belvi/mobilevisionbarcodesample/MainActivity;
at mvbarcodescannerwrapper.mvbarcodescannerWrapper.Initialize(mvbarcodescannerWrapper.java:74)
at JHS.MVBarcodeScanner.main._activity_create(main.java:387)
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.MVBarcodeScanner.main.afterFirstLayout(main.java:104)
at JHS.MVBarcodeScanner.main.access$000(main.java:17)
at JHS.MVBarcodeScanner.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
Caused by: java.lang.ClassNotFoundException: xyz.belvi.mobilevisionbarcodesample.MainActivity
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/AppCompatActivity;
... 18 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.AppCompatActivity" on path: DexPathList[[zip file "/data/app/JHS.MVBarcodeScanner-_xprUJ82HumfnZj-aKydYA==/base.apk"],nativeLibraryDirectories=[/data/app/JHS.MVBarcodeScanner-_xprUJ82HumfnZj-aKydYA==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more
** Activity (main) Resume **
 

CStorSupport

Member
Licensed User
After jetification it finally ran to it's first button: "Start MVBarcodeScanner".
Tapping it made it crash with this in the Logs:
Logger connected to: motorola XT1635-01
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
--------- beginning of crash
java.lang.RuntimeException: Unable to start activity ComponentInfo{JHS.MVBarcodeScanner/xyz.belvi.mobilevisionbarcodesample.MainActivity}: android.view.InflateException: Binary XML file line #43: Binary XML file line #43: Error inflating class android.support.v7.widget.SwitchCompat
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2974)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
Caused by: android.view.InflateException: Binary XML file line #43: Binary XML file line #43: Error inflating class android.support.v7.widget.SwitchCompat
Caused by: android.view.InflateException: Binary XML file line #43: Error inflating class android.support.v7.widget.SwitchCompat
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.SwitchCompat" on path: DexPathList[[zip file "/data/app/JHS.MVBarcodeScanner-Zu15MXToK7MGJJc1kNBzow==/base.apk"],nativeLibraryDirectories=[/data/app/JHS.MVBarcodeScanner-Zu15MXToK7MGJJc1kNBzow==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.view.LayoutInflater.createView(LayoutInflater.java:606)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at xyz.belvi.mobilevisionbarcodesample.MainActivity.onCreate(MainActivity.java:59)
at android.app.Activity.performCreate(Activity.java:6989)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1235)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2848)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2974)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)


I've started testing Barcode reader based on Google Play Services Vision.
It runs,
activates the back camera and displays a nice, clear view wherever I point it,
places the buttons on the screen.
The buttons, when tapped, have a barely perceptable animation to indicate the tap. (I will try to copy that effect)
But even before pressing any of the buttons the Logs fill up with this:
Logger connected to: motorola XT1635-01
--------- beginning of crash
--------- beginning of main
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
1
2
facing: 0, 0
Preview Orientation: 0
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
Preview Orientation: 90
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
Preview Orientation: 90
Error occurred on line: 115 (Main)
java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:757)
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 anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1083)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1038)
at anywheresoftware.b4a.samples.camera.cameraexclass._camera_preview(cameraexclass.java:639)
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 anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.CameraW$2$1$1.onPreviewFrame(CameraW.java:147)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1175)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
** Activity (main) Pause, UserClosed = true **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Is detector operational: true
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
Preview Orientation: 90
Error occurred on line: 115 (Main)
java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:757)
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 anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1083)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1038)
at anywheresoftware.b4a.samples.camera.cameraexclass._camera_preview(cameraexclass.java:639)
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 anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.CameraW$2$1$1.onPreviewFrame(CameraW.java:147)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1175)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Is detector operational: true
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
Preview Orientation: 90


image000000.png
 

CStorSupport

Member
Licensed User
After jetification it finally ran to it's first button: "Start MVBarcodeScanner".
Tapping it made it crash with this in the Logs:
Logger connected to: motorola XT1635-01
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
--------- beginning of crash
java.lang.RuntimeException: Unable to start activity ComponentInfo{JHS.MVBarcodeScanner/xyz.belvi.mobilevisionbarcodesample.MainActivity}: android.view.InflateException: Binary XML file line #43: Binary XML file line #43: Error inflating class android.support.v7.widget.SwitchCompat
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2974)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
Caused by: android.view.InflateException: Binary XML file line #43: Binary XML file line #43: Error inflating class android.support.v7.widget.SwitchCompat
Caused by: android.view.InflateException: Binary XML file line #43: Error inflating class android.support.v7.widget.SwitchCompat
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.SwitchCompat" on path: DexPathList[[zip file "/data/app/JHS.MVBarcodeScanner-Zu15MXToK7MGJJc1kNBzow==/base.apk"],nativeLibraryDirectories=[/data/app/JHS.MVBarcodeScanner-Zu15MXToK7MGJJc1kNBzow==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.view.LayoutInflater.createView(LayoutInflater.java:606)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at xyz.belvi.mobilevisionbarcodesample.MainActivity.onCreate(MainActivity.java:59)
at android.app.Activity.performCreate(Activity.java:6989)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1235)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2848)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2974)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)

I've started testing Barcode reader based on Google Play Services Vision.
It runs,
activates the back camera and displays a nice, clear view wherever I point it,
places the buttons on the screen.
The buttons, when tapped, have a barely perceptable animation to indicate the tap. (I will try to copy that effect)
But even before pressing any of the buttons the Logs fill up with this:
Logger connected to: motorola XT1635-01
--------- beginning of crash
--------- beginning of main
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
1
2
facing: 0, 0
Preview Orientation: 0
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
Preview Orientation: 90
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
Preview Orientation: 90
Error occurred on line: 115 (Main)
java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:757)
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 anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1083)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1038)
at anywheresoftware.b4a.samples.camera.cameraexclass._camera_preview(cameraexclass.java:639)
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 anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.CameraW$2$1$1.onPreviewFrame(CameraW.java:147)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1175)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
** Activity (main) Pause, UserClosed = true **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Is detector operational: true
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
Preview Orientation: 90
Error occurred on line: 115 (Main)
java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:757)
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 anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1083)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1038)
at anywheresoftware.b4a.samples.camera.cameraexclass._camera_preview(cameraexclass.java:639)
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 anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.CameraW$2$1$1.onPreviewFrame(CameraW.java:147)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1175)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6695)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Is detector operational: true
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
Preview Orientation: 90
 

CStorSupport

Member
Licensed User
There are no errors in these logs. These are just previous debug runs.
For MVBarcodeScanner
Search for​
java.lang.RuntimeException: Unable to start activity ComponentInfo{JHS.MVBarcodeScanner/xyz.belvi.mobilevisionbarcodesample.MainActivity}:​

For Barcode reader based on Google Play Services Vision
I can't explain why but everything posted below this line​
But even before pressing any of the buttons the Logs fill up with this:
happened in a single run.​
Search for​
java.net.SocketException: Socket closed​
However, when running it this morning, the error didn't occur.​
Just this in the Logs:​
Logger connected to: motorola XT1635-01​
--------- beginning of crash​
--------- beginning of main​
*** Service (starter) Create ***​
** Service (starter) Start **​
** Activity (main) Create, isFirst = true **​
Is detector operational: true​
** Activity (main) Resume **​
findCamera​
null​
2​
facing: 0, 0​
findCamera​
0​
2​
facing: 0, 0​
Preview Orientation: 90​
Nonetheless, the button 'Take Picture' does nothing but animate the hit when tapped.​
I decided to try another run:​
'Stop' and then 'Start' the B4A-Bridge v2.61​
Reconnect the project to the Bridge (I didn't exit the project, just reconncected it)​
Clear the Logs panel​
Clicked 'run' on the toolbar and this filled the Logs panel:​
Logger connected to: motorola XT1635-01​
--------- beginning of crash​
--------- beginning of main​
*** Service (starter) Create ***​
** Service (starter) Start **​
** Activity (main) Create, isFirst = true **​
Is detector operational: true​
** Activity (main) Resume **​
findCamera​
null​
2​
facing: 0, 0​
findCamera​
0​
2​
facing: 0, 0​
Preview Orientation: 90​
Error occurred on line: 115 (Main)​
java.net.SocketException: Socket closed​
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)​
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)​
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)​
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)​
at java.io.DataOutputStream.flush(DataOutputStream.java:123)​
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:757)​
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 anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1083)​
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1038)​
at anywheresoftware.b4a.samples.camera.cameraexclass._camera_preview(cameraexclass.java:639)​
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 anywheresoftware.b4a.BA.raiseEvent(BA.java:176)​
at anywheresoftware.b4a.objects.CameraW$2$1$1.onPreviewFrame(CameraW.java:147)​
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1175)​
at android.os.Handler.dispatchMessage(Handler.java:105)​
at android.os.Looper.loop(Looper.java:164)​
at android.app.ActivityThread.main(ActivityThread.java:6695)​
at java.lang.reflect.Method.invoke(Native Method)​
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)​
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)​
** Activity (main) Pause, UserClosed = true **​
** Service (starter) Destroy (ignored)**​
*** Service (starter) Create ***​
** Service (starter) Start **​
** Activity (main) Create, isFirst = true **​
Is detector operational: true​
** Activity (main) Resume **​
findCamera​
null​
2​
facing: 0, 0​
findCamera​
0​
2​
facing: 0, 0​
Preview Orientation: 90​
 

CStorSupport

Member
Licensed User
Many apologies.

Finally used "ALL_FORMATS".

Successfully reads UPC-A and UPC-E.

Codes "UPC-A" and "UPC-E" crash the app with these errors:
java.lang.RuntimeException: Field: UPC-A not found in: com.google.android.gms.vision.barcode.Barcode
java.lang.RuntimeException: Field: UPC-E not found in: com.google.android.gms.vision.barcode.Barcode
 
Status
Not open for further replies.
Top