我不想仅为我的应用程序创建自定义本机模块 - 所以没有库。按照文档,它给了我一个错误:
import com.facebook.react.bridge.ReactContextBaseJavaModule;
无法解析符号“ReactContextBaseJavaModule”
我的应用程序
android/app/build.gradle
包含这一行,它也包含在我迄今为止使用的所有 react-native 模块中。"com.facebook.react:react-native:+" // From node_modules
我的
android/build.gradle
:// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { 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 } } allprojects { repositories { mavenLocal() jcenter() mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.fabric.io/public' } maven { url 'https://maven.google.com' } } }