React Native app stuck on splash screen after a package update

Viewed 3811

My application was previously working fine, no build or runtime errors. Then I updated react-native-agora from ^2.9.1 to ^3.0.1-rc.4. Had a crash issue which was solved by

  • pod install
  • react-native start --reset-cache

My issue now is that the application is stuck on the splash screen and giving this error on iOS RN v0.61.5:

Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

So far I've tried:

  • adding index.ios.js file and adding entry point code
  • removing and re-installing node_modules
  • npm cache clean
  • cleaning and re-building project in Xcode
  • restarting computer
  • killall -9 node
  • react-native start --reset-cache
  • deleting app in simulator and re-building/running
  • deleted pods folder and pod install
  • commenting out all react-native-agora code

I have not:

  • run any form of react-native link on this agora package. I'm on v0.61.5

Also:

  • because react-navigation is auto linked in .61.5, I believe there should be some kind of development pod in Xcode. I haven't looked when it was working, so nothing to compare to. but I dont see react-navigation in the dev pods, but i see its peer dependencies

development pods

my package.json:

"dependencies": {
        "@react-native-community/cli": "^4.3.0",
        "@react-native-community/clipboard": "^1.2.2",
        "axios": "^0.19.2",
        "moment": "^2.24.0",
        "moment-timezone": "^0.5.27",
        "prop-types": "^15.7.2",
        "react": "16.9.0",
        "react-native": "^0.61.5",
        "react-native-agora": "^3.0.1-rc.4",
        "react-native-algolia-dropdown": "^1.6.0",
        "react-native-calendars": "^1.220.0",
        "react-native-chart-kit": "^4.3.0",
        "react-native-code-push": "^6.0.0",
        "react-native-extended-stylesheet": "^0.12.0",
        "react-native-firebase": "^5.6.0",
        "react-native-gesture-handler": "^1.5.2",
        "react-native-image-crop-picker": "^0.26.1",
        "react-native-material-dropdown": "^0.11.1",
        "react-native-reanimated": "^1.4.0",
        "react-native-responsive-screen": "^1.4.1",
        "react-native-safe-area-context": "^0.6.2",
        "react-native-screens": "^1.0.0-alpha.23",
        "react-native-snap-carousel": "^3.8.4",
        "react-native-splash-screen": "^3.2.0",
        "react-native-svg": "^9.13.6",
        "react-native-view-shot": "^3.1.2",
        "react-native-webview": "^9.4.0",
        "react-navigation": "^4.0.10",
        "react-navigation-drawer": "^2.3.3",
        "react-navigation-stack": "^1.10.3",
        "react-redux": "^7.1.3",
        "redux": "^4.0.4",
        "redux-persist": "^6.0.0",
        "redux-thunk": "^2.3.0",
        "rn-fetch-blob": "^0.11.2"
    },

index.js & index.android.js are identical:

import { AppRegistry } from 'react-native';
import App from './App';
import 'react-native-gesture-handler';
import { name as Project } from './app.json';

AppRegistry.registerComponent(Project, () => App);

EDIT (Debugger output):

  • theres a lot of Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. these are output from a variety of sources, from my components, to firebase, to other npm packages
  • a lot of complaints about still trying to use the react-native-agora package

How can I get this resolved?

2 Answers

In this case, there was still some remnants of the newly updated package after initially trying to remove all existence of it for debugging purposes. Ive got the app running properly now by fully removing all code from react-native-agora. theres an issue with all their documentation and example projects not having been updated for the new version.

Modeling my chatroom component off this repo: https://github.com/AgoraIO-Community/Agora-RN-Quickstart/blob/master/App.tsx is what eventually got react-native-agora working for me.

Related