question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

Could anyone help me figuring out why the generation of the QR code is invalid?

Thank you!

image

I’m using the following dependencies:

"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-qrcode-svg": "^6.0.6",
"react-native-svg": "^12.1.0",

And the code is based on this example:

import * as React from "react";
import { View, StyleSheet } from "react-native";
import SvgQRCode from "react-native-qrcode-svg";

// Simple usage, defaults for all but the value
function Simple() {
  return (
    <SvgQRCode
      size={200}
      color={"#2e78b7"}
      value="Hello everyone! This is a test!"
    />
  );
}

export default function QRGeneratorScreen() {
  return (
    <View style={styles.container}>
      <View
        style={{
          width: "100%",
          flexDirection: "row",
          justifyContent: "space-around",
          alignItems: "center",
        }}
      >
        <Simple />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "space-around",
    paddingTop: 20,
    alignItems: "center",
    backgroundColor: "#ecf0f1",
  },
});

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
EmmanuelSkapplecommented, May 1, 2020

Hi, I had the same error, I could solve it by entering the library and adding the attribute:

strokeLinecap={'square'} Line 141 index.js file

this eliminates the rounded shape

and modify the algorithm in the class ./src/tranformMatrixIntoPath.js

Line 2 add const cellSize = size / matrix.length - 0.1 Line 9 add path += 'M${cellSize * j+9} ${cellSize / 2 + cellSize * i}'

this to adjust the width and Height of the squares generated by the algorithm

1reaction
snahrvarcommented, May 16, 2020

@EmmanuelSkapple That did the trick for me! I found it odd how the QR Code was shaped, and your solution brought it all together. Looks normal and works now. It would be great if this was the default for the package.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving "Invalid" QR code issues - Circle Support Center
If you scan the QR code on your Circle Home Plus and get an error saying it is invalid, it's possible the QR...
Read more >
12 Reasons why your QR code is not working
QR codes are not working for a variety of reasons. ... Invalid QR code or the URL where the QR code links to...
Read more >
Unable to Scan QR Code? Here's How to Fix a QR Code.
If a QR code won't scan, it could be because the QR code error correction level is too low for the amount of...
Read more >
Invalid QR Code: How to Avoid Silly Mistakes - Scanova
A. The most common mistakes that render a QR Code invalid · 1. Selecting an inverted color scheme · 2. Over-customization · 3....
Read more >
Missing or invalid QR codes - Google Cardboard Help
If you can't find a QR code on your Cardboard viewer · On your computer, go to the viewer manufacturer's website, and then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found