question

gonogo_dev avatar image
gonogo_dev asked ·

Unable to launch scanner in production

We're able to successfully open the camera/scanner on mini and station 2018 dev kits but when we push it to production it does not launch the scanner. Is this a permission issue? Has anyone else encountered this?
barcode scanner
2 comments
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @gonogo_dev. Why do you believe that this is a permission issue? Can you provide any error logs or code to show how you're launching the barcode reader? Please review our Asking and Answering Questions guide and provide additional detail.

0 Likes 0 · ·
We don't know if it's a permission issue or not. It's working on both dev kits (mini and 2018 station) but is not working on multiple client production models.

We don't have errors logs for production devices. Is there a way to obtain them?

We're following this sample code: https://github.com/clover/android-examples/blob/master/barcodereceiver/app/src/main/java/com/clover/example/barcodereceiver/app/MainActivity.java


We have a function that starts the barcode scanner. The relevant code is below:
registerBarcodeScanner();
return new BarcodeScanner(this).startScan(getBarcodeSetting(true));

I'm also copying in the register barcode scanner function below:
private void registerBarcodeScanner() {
registerReceiver(barcodeReceiver, new IntentFilter(BARCODE_BROADCAST));
}
0 Likes 0 · ·

1 Answer

Chanel avatar image
Chanel answered ·
Hi @gonogo_dev, if you'd like error logs, you can implement Crashlytics into your app to send to your system w/o merchant involvement.

Your code does look right. Here's a sample that I've had success with, both in sandbox and production.

private BarcodeScanner mBarcodeScanner;

mBarcodeScanner = new BarcodeScanner(this);

mBarcodeOnButton = (Button) findViewById(R.id.barcode_button);
mBarcodeOnButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Bundle extras = new Bundle();
        extras.putBoolean(Intents.EXTRA_LED_ON, false);
        extras.putBoolean(Intents.EXTRA_SCAN_QR_CODE, true);
        extras.putBoolean(Intents.EXTRA_SCAN_1D_CODE, true);
        mBarcodeScanner.startScan(extras);
    }
});
3 comments Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@Chanel

Thanks for your quick response. To answer your question, we already have Crashlytics installed and there are no errors because it's not crashing when it fails to launch the camera.

Are you able to test our latest APK that was submitted on a production device that's not a 2018 station?

0 Likes 0 · ·

Crashlytics has the ability to log additional errors if you set it up to do so. I suggest updating your code with strategic try/catch blocks, so that you're able to view any relevant logs on your end.

0 Likes 0 · ·

@chanel we have tried the above code on a production station and it still will not launch the camera at all. No logs are coming back either. Are you able to test our APK on a production clover station?

0 Likes 0 · ·

Welcome to the
Clover Developer Community