Giter VIP home page Giter VIP logo

react-native-barcode-scanner's Introduction

바코드 스캐너 앱

React Native 로 구현한 바코드 스캐너 앱입니다. (Android 기기에서만 테스트된 앱입니다.)

screenshot_1 screenshot_2

npm install
cd android && ./gradlew clean
yarn android

1. react-native-camera-kit 설정

  • 구버전 React Native 에서 react-native-camera-kit 을 사용하려면 다음과 같이 설정해야합니다.

1. Kotlin 버전 설정

android/build.gradle에 다음과 같이 Kotlin 버전을 추가합니다.

buildscript {
    ext {
        kotlin_version = "1.6.21"
    }
    dependencies {
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
    }
}

2. Android 버전 설정

android/build.gradle 에서 버전을 다음과 같이 설정합니다.

buildscript {
    ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 23
        compileSdkVersion = 31
        targetSdkVersion = 29
    }
}

여기서 중요한 부분은 minSdkVersion인데, 해당 버전은 react-native-camera-kit 라이브러리 버전에 따라 달라질 수 있습니다.
프로젝트를 실행 했을 때 이와 관련된 오류가 뜬다면, 오류 메시지에 minSdkVersion에 대한 버전을 설정하라는 메시지가 출력될 것입니다.

3. react-native-camera-kit의 Android 버전 설정

node_modules/react-native-camera-kit/android/build.gradle을 확인합니다.
compileSdkVersion, buildToolsVersion, minSdkVersion, targetSdkVersion 을 확인하고, android/build.gradle에서 확인한 버전과 동일 한지 확인합니다.
만약 동일하지 않다면 android/build.gradle에 설정된 버전으로 동일하게 설정해주세요.

2. Android 카메라 권한 설정

android/app/main/AndroidManifest.xml에서 카메라 접근 권한을 추가합니다.

    <uses-permission android:name="android.permission.INTERNET" />
    ...
    <uses-permission android:name="android.permission.CAMERA" />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.