react-native-ble-manager在安卓端的配置

npm i --save react-native-ble-manager
react-native link react-native-ble-manager
//在AndroidManifest.xml文件中添加权限
 
 
//在build.gradle文件中修改最低的sdk版本
buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 19  //默认16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

官方教程:https://github.com/innoveit/react-native-ble-manager

你可能感兴趣的:(react-native-ble-manager在安卓端的配置)