Search code examples
androidqr-code

Why does my QR code not work with the Android camera?


I have made a QR code with the same URL using two different methods and one works with my Android 8.0 camera and the other does not.

Why is this and what is the difference?

Ideally I want to replicate what qr-code-generator.com does so my code generated QR works on the default Android camera app.

Device: Motorola G6 (XT1925-5) Android 8.0.0 Same issue reported with user Android devices but no device details yet.

The QR code images are for reference. If you are concerned about scanning them just generate one from the websites listed yourself and try to scan it. Both QRs contain the url https://cat-bounce.com/

I have used several only QR code decoders as they all say the url contained in the QR code is the same, although the QR code looks visibly different.

Option 1 - Works in default Android 8.0 camera. https://www.qr-code-generator.com/

  1. Owned by bitly.
  2. Works fine for iOS native camera and Google Lens. enter image description here

Option 2 - Does not work in default Android 8.0 camera. https://qr-code-styling.com/

  1. I use this in my app to generate the QR codes in Javascript but used the website for the attached image.
  2. I tried to make it as similar as possible and used Error Correction Level M which I believe bitly uses.
  3. Works fine for iOS native camera and Google Lens. enter image description here

UPDATE:

  • Apologies if more information is needed but I am more familiar with iOS. Device information has been added.

  • I have used https://zxing.org/ to analyze the codes and while the raw bytes are different the url contained and everything else is the same.


Solution

  • It turns out there is a bug in the package that I am using. https://github.com/kozakdenys/qr-code-styling

    See the details here: https://github.com/kozakdenys/qr-code-styling/issues/49 https://github.com/kozakdenys/qr-code-styling/pull/110

    No permanent solution available yet.