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

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:+'
    }
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容