首页 > 解决方案 > null is not an object (evaluating 'nativeInterface.configure') in a React-Native app

问题描述

I'm working on making this React Native app work on Android. It's already working on iOS.

I've encountered the following error and have no clue where to start looking.

enter image description here

As far as I can understand it's an issue with firebase but not much else is clear. Here is the firebase and react-native versions:

"react-native": "0.62.2",
"firebase": "^7.16.1",
"react-native-location": "^2.5.0"

I've ran rm -rm node_modules && npm i, also cleaned and rebuild the Android project but to no avail.

Edit: After some investigation, the nativeInterface.configure is called in react-native-location, index.js, line 53:

exports.configure = function (options) {
    return nativeInterface.configure(options);
};

Edit 2: From logcat you can see that this error occurs right after this one:

020-07-19 21:07:37.884 7994-8029/? E/unknown:ReconnectingWebSocket: Error occurred, shutting down websocket connection: Websocket exception
    java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:215)

标签: androidreactjsfirebasereact-native

解决方案


好吧,你知道什么……我跑了react-native link react-native-location,然后就修好了。


推荐阅读