异常
Can't find variable: Symbol
解决方法
- 在你的
package.json
中的dependencies
添加jsc-android
"dependencies": {
"jsc-android": "^236355.1.1"
},
或者直接使用命令npm install --save jsc-android
- 修改
android/build.gradle
文件
allprojects {
repositories {
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// Local Maven repo containing AARs with JSC library built for Android
url "$rootDir/../node_modules/jsc-android/dist"
}
}
}
- 修改
android/app/build.gradle
文件
+configurations.all {
+ resolutionStrategy {
+ force 'org.webkit:android-jsc:r236355'
+ }
+}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
}