Android Question [SOLVED] Barcode Scanners | Works on step thru debugging, not on normal run

konradwalsh

Active Member
Licensed User
Longtime User
I am clearly doing some thing wrong..
I have tried all 3 Barcode libraries and classes and I have the same issue with all of them..

I tie the Scanner to a button called scan now
it crashes the app with

android.content.res.Resources$NotFoundException: Resource ID #0x0

If I put a breakpoint here and step through line by line.. I works fine....

B4X:
Private zx1 As ZxingBarcodeScanner


B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout")

    zx1.LaserColor = Colors.Yellow
    zx1.MaskColor = Colors.ARGB(70, 100, 10, 100)
    zx1.BorderColor = Colors.Magenta
    zx1.BorderStrokeWidth = 1
    zx1.BorderLineLength = 10
    zx1.Visible = True

  
End Sub


B4X:
Sub btnScanBarcode_Click
  
zx1.Visible = True
    zx1.startScanner

End Sub
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

konradwalsh

Active Member
Licensed User
Longtime User
The ressources are inside the example project as files in the RES folder which needs to be set to readonly before compiling
Thanks.. I didn't think of this as I was having the issue with samples I downloaded as well as my own app.. but using the script to mark readonly seems to have fixed it up

thanks very much
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
Thanks.. I didn't think of this as I was having the issue with samples I downloaded as well as my own app.. but using the script to mark readonly seems to have fixed it up

thanks very much
It will be much easier to help you if you ask your question(s) in the applicable forum so that we know what project your question(s) relate to.
 
Upvote 0
Top