Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Can't scan QR-code on Android 6 and 8 #346

Closed
yuriy-budiyev opened this issue Aug 10, 2017 · 24 comments
Closed

Can't scan QR-code on Android 6 and 8 #346

yuriy-budiyev opened this issue Aug 10, 2017 · 24 comments

Comments

@yuriy-budiyev
Copy link

yuriy-budiyev commented Aug 10, 2017

Nothing happenson Android 6 and 8, but works fine on 4.4, tested on QR-code.

@yuriy-budiyev yuriy-budiyev changed the title Can't scan on Android O Can't scan QR-code on Android 6 and 8 Aug 10, 2017
@yuriy-budiyev
Copy link
Author

Somehow, it started to scan on 6, but still dead on 8.

@tempanyman
Copy link

I also have issues on android 7. I'm using a nexus 5x, api 24 and 25. Works fine on API 23 (Marshmallow).

@dm77
Copy link
Owner

dm77 commented Aug 11, 2017

Hi @yuriy-budiyev, few questions for you:
a.) What devices are you testing on?
b.) Are you using zbar or are you using zxing?
c.) Are you testing using the zxing-sample or zbar-sample? If not, can you test the samples on your devices as well?

Thank you

@tempanyman
Copy link

Not OP, but some more info it it helps:
I am using zxing, and I tested with the zxing-sample to no avail on my Nexus devices.

@yuriy-budiyev
Copy link
Author

yuriy-budiyev commented Aug 11, 2017

Device: LG Nexus 5X
Scanner: zxing
Config: targetSdk 26, build tools 26.0.1, Android Studio 3.0 beta 1, support libraries 26.0.1

I tested on many QR-codes. The thing is that the same code is scanned well on Galaxy S4 mini with Android 4.4, and not scanned on Android 8

Where I can find the sample?

@yuriy-budiyev
Copy link
Author

Official zxing app works well on the same codes on 8

@dm77
Copy link
Owner

dm77 commented Aug 11, 2017

@tempanyman thank you. Does it happen on all your Nexus devices? Because I have the zxing-sample working fine on my Nexus 5 phone. Nexus 5x is a different issue though (see below)

@yuriy-budiyev As you might already know Nexus 5x camera orientation is reverse landscape and apparently that causes issues with scanning in portrait mode. The fixes in version 1.9.4, 1.9.5 and 1.9.6 were all aimed at fixing Nexus 5x portrait mode scanning. See the pull request #315 for example.

So are the issues here limited to just Nexus 5x then? If so, does scanning work when you scan in landscape mode? Thanks for your help

@yuriy-budiyev
Copy link
Author

Yes, it works in landscape mode.
But my app needs portrait mode.

@yuriy-budiyev
Copy link
Author

yuriy-budiyev commented Aug 11, 2017

But earlier versions worked well on nexus 5x and android 7 in portrait mode

@yuriy-budiyev
Copy link
Author

yuriy-budiyev commented Aug 11, 2017

Can you fix this please?

@dm77
Copy link
Owner

dm77 commented Aug 12, 2017

@yuriy-budiyev - For now, can you revert back to whatever version that was working for you previously? There are no huge code improvements between 1.9.3 and 1.9.7. The only change was the pull request that tried to fix Nexus5X. So may be 1.9.3 should resolve your issue.

@yuriy-budiyev
Copy link
Author

Hi, I coundn't wait, code scanning is critical for my app. So I solved the rotation problem in my lib (it's unfinished), you can see the code here. Hope it help you c;

@dm77
Copy link
Owner

dm77 commented Aug 15, 2017

@yuriy-budiyev Thanks for pointing me to your repo. Would it be possible for you to submit a pull request?

@dm77
Copy link
Owner

dm77 commented Aug 15, 2017

@yuriy-budiyev Also to be clear, the issue was only limited to Nexus5x device.

@yuriy-budiyev
Copy link
Author

yuriy-budiyev commented Aug 15, 2017

I don't know how you can just pull from my repo, or I don't understand you. I think this problem can't be limited to nexus 5x, because any device has camera rotation in portrait mode (for example). So it would be better to rotate image from camera before giving it to the decoder.

@dm77
Copy link
Owner

dm77 commented Aug 15, 2017

@yuriy-budiyev It is only limited to Nexus 5x since it has reverse landscape camera orientation. For example see #315

1.9.7 works on 5 devices I personally tested on and there are many who confirm that it works fine on their devices in #336 and #339

Regarding the pull request, I was just hoping you could submit something similar to #315. Seems like you are not aware how that works.

Thank you anyway.

@dm77 dm77 closed this as completed Aug 15, 2017
@dm77
Copy link
Owner

dm77 commented Aug 15, 2017

You can also find similar reports related to the Nexus5x devce in the official zxing repo zxing/zxing#484

@dm77
Copy link
Owner

dm77 commented Aug 19, 2017

@yuriy-budiyev I just released 1.9.8 which resolves the issue on Nexus 5x. Can you please check if you are still interested? Thank you

@filipiandrader
Copy link

Doesn't works on Samsung S8 with API 26. I'm using ZXing scanner. The problem is when I open my Activity where I'm using the scanner, I don't have any camera (appears a blank screen) but on API 22 works fine!

Blank Screen on API 26:
screenshot_20180717-152910_pronto

API 22:
screenshot_2018-07-17-15-30-08

@harmansoft
Copy link

@filipiandrader I have Exact same issue and search entire web for it, but i cannot find anything useful.please if you find the answer let me now

@filipiandrader
Copy link

@Zirocool I didn't find anything.

@hrshs
Copy link

hrshs commented Aug 20, 2018

I have same issue in tablet lenovo TB-7304.

@CAA0558
Copy link

CAA0558 commented Dec 19, 2018

Please provide the camera permission, it works. (Setting-> apps-> appname->permission->camera->enabled)

@chrisegb
Copy link

chrisegb commented May 28, 2019

Hi @dm77 I am working with the same functionality to read a QR code, unfortunately my app stops running showing a unsatisfied link error in the the line 45, in this line I have an initializer:

System.loadLibrary("iconv");

I have been tested in three devices a Motorola with Android 7, another Motorola with Android 6 and a Panasonic with Android 5, regarding to this, it works perfectly in Android 5 but does not in Android 7 or 6.

I found that for Android 6 and further I have to update the files into the jniLibs folder with the files that I found at [1], my main worry here is if this files will impact another part of my application or they are just related to ZBar scan reader. Did you have tested the ZBar scan reader in Android versions higher than 5?

Does anybody know if "update the files into jniLibs folder" is the correct solution for this issue [2].

Regards.

[1] https://github.com/dm77/barcodescanner/tree/master/zbar/src/main/jniLibs
[2] https://stackoverflow.com/questions/33152903/zbar-barcode-scanning-library-not-working-when-using-target-sdk-version-23-in-gr

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants