-
Notifications
You must be signed in to change notification settings - Fork 105
Download & Installation
Melih Yarıkkaya edited this page Apr 18, 2019
·
2 revisions
$ npm install --save react-native-serialport
or
$ yarn add react-native-serialport
$ react-native link react-native-serialport
- 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 thegetPackages()
method
- 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')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:
implementation project(':react-native-serialport')