Skip to content

Download & Installation

Melih Yarıkkaya edited this page Apr 18, 2019 · 2 revisions

Download

$ npm install --save react-native-serialport
or
$ yarn add react-native-serialport

Most Automatic Installation

$ react-native link react-native-serialport

Manual Installation

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNSerialportPackage; to the imports at the top of the file
  • Add new RNSerialportPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
include ':react-native-serialport'
project(':react-native-serialport').projectDir = new File(rootProject.projectDir,  
'../node_modules/react-native-serialport/android')
  1. Insert the following lines inside the dependencies block in android/app/build.gradle:
implementation project(':react-native-serialport')
Clone this wiki locally