安卓android集成react-native时,闪退

2020-08-20  本文已影响0人  YQSummer

react-native > 0.63.2

安卓集成react-native时根据官网提供的文档配置后,跳转到rn页面时闪退,或者页面不出现,可以试试下面的方法:

下载第三方依赖

yarn add jsc-android

在android/build.gradle
allprojects{}里配置

        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

在app/build.gradle
dependencies{}里配置

 def useIntlJsc = false
  if (useIntlJsc) {
    implementation 'org.webkit:android-jsc-intl:+'
    } else {
    implementation 'org.webkit:android-jsc:+'
    }
上一篇 下一篇

猜你喜欢

热点阅读