项目结构

Android native部分

react部分

Android Native 配置node_modules目录

local.properties配置

sdk.dir=E\:\\Android\\Sdkreact.path=E\:\\ReactNative\\MyReactNativeApp\\react

settings.gradle配置

include ':react-native-gesture-handler', ':common-silent', ':appservice', ':senseid-liveness-silent-offline', ':appcore'logger.info(rootDir.path)File file = new File(rootDir.path,"local.properties")println file.pathProperties mp = new Properties()mp.load(new FileInputStream(file))include ':react-native-gesture-handler'project(':react-native-gesture-handler').projectDir = new File(mp.getProperty("react.path"), '\\node_modules\\react-native-gesture-handler\\android')include ':app'

build.gradle配置

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    ext.kotlin_version = '1.3.40'    ext.kotlin_version = '1.3.31'    ext.kotlin_version = '1.2.71'    repositories {        google()        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:3.2.1'        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}def loadLocalProp() {    File file = rootProject.file("local.properties")    if (file.exists()) {        Properties mp = new Properties()        mp.load(rootProject.file("local.properties").newDataInputStream())        def local = [:]        mp.keySet().each {            local[it] = mp.getProperty(it.toString())        }        return local    }}def local = loadLocalProp()allprojects {    repositories {        google()        jcenter()        maven {            // All of React Native (JS, Android binaries) is installed from npm            url "${local['react.path']}/node_modules/react-native/android"        }    }}task clean(type: Delete) {    delete rootProject.buildDir}

在react目录下 yarn install yarn start

更多相关文章

  1. Android(安卓)javah -jni 找不到类的解决方法
  2. Finished with error: ProcessException: Process "D:\FlutterA
  3. AVD那些事儿
  4. cocos2d-x环境搭建 for eclipse
  5. Android(安卓)6编译环境搭建 (Marshmallow)
  6. 【Android笔记】Android统计文件夹大小,删除文件夹下的所有文件方
  7. android 加载动态库
  8. android 学习之安装
  9. Qt5.1.1 for android 环境配置

随机推荐

  1. Android:apk文件结构及打包技巧
  2. android开发学习大纲
  3. Android经典的大牛博客推荐
  4. android:使用Gon解析解析json
  5. Android(安卓)java.io.IOException异常情
  6. android初次学习(android studio安装及注
  7. Android:onTouch()和onTouchEvent()的区
  8. Android中的sqlite Cursor操作详解
  9. Android图形系统分析与移植 -- 三、内核
  10. Android多媒体播放器源码解析(stagefrigh