繁体   English   中英

将本机代码集成到现有的 android 项目中

[英]Integrating react native code into existing android project

将 react native 代码集成到现有的 android 项目中,遇到以下错误。

引起:java.lang.IllegalAccessError: Method 'void androidx.core.net.ConnectivityManagerCompat.()

我们正在尝试将 react native 项目添加到现有的 android 应用程序中。 使用以下参考链接:

https://medium.com/mindorks/react-native-integration-with-existing-app-f2757c2e672d

. 从 Android Main 活动切换到 Reactnative 活动时,我们得到以下异常

引起:java.lang.IllegalAccessError: Method 'void androidx.core.net.ConnectivityManagerCompat.()' is inaccessible to class 'com.facebook.react.modules.netinfo.NetInfoModule'('com.facebook.react. modules.netinfo.NetInfoModule`

. 请建议。

您链接的指南已有 3 年历史,在此期间 RN(以及 Android、Gradle 等)发生了很多变化。

你可以试试这个指南: https : //blog.usejournal.com/integrating-react-native-with-existing-android-apps-efficiently-3b39f2e061bd 几周前我用过它,它对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM