title: React Native "Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)"
body: <p>There are many other posts with this same title, but most of them are outdated and the answers haven't worked for me. These are some of the fixes I've tried that have failed:</p>
  <ul>
  <li>&quot;react-native start --reset-cache&quot;</li>
  <li>&quot;npm start -- --reset-cache&quot;</li>
  <li>&quot;npm run android --reset-cache&quot;</li>
  <li>&quot;cd android -&gt; gradlew clean -&gt; cd..&quot;</li>
  <li>deleting and reinstalling the node_modules folder</li>
  <li>deleting and reinstalling node_modules folder before and after updating react-native and doing /npm audit fix. It says there's 0 vulnerabilities</li>
  <li>yarn install and yarn upgrade</li>
  </ul>
  <p>This problem happens when I try to run it, even after restarting my computer. I use <strong>npm run android</strong> to start the app. I noticed that around the time this stopped working, I accidentally added some typescript files to the project without any additional packages. I have since removed them, but is it possible that's what's causing it? I don't believe its a problem with the entry file path as the error states for the reason mentioned below.</p>
  <p>Does anyone have any other ideas how to fix it? If any more code snippets are needed let me know. Any further questions or advice that could lead the way is appreciated</p>
  <p>My getJSMainModuleName() returns &quot;index&quot; which should be correct, as thats worked in the past on this project, which makes me believe it may not be the entry file path thats incorrect like the error says it could be.</p>
  <p>This is the full console output from metro when I do &quot;npm run android&quot;. I don't think the cycle or the referenceerror are causing the invariant violation.</p>
  <pre><code> BUNDLE  ./index.js
  
   WARN  Require cycle: src\component\FeedList.js -&gt; src\component\FeedCell.js -&gt; src\component\TagDetail.js -&gt; src\component\FeedList.js
  
  Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
   ERROR  ReferenceError: Can't find variable: i
   ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
        This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
   ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
        This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
  </code></pre>
  <p>When I reload the app, I get the same error but there are 4 of the same invariant violations instead of 2. (noting this incase its relevant)</p>
  <p>Below are selected files from my project</p>
  <p>index.js</p>
  <pre class="lang-js prettyprint-override"><code>import React, { Component } from 'react';
  import { Provider } from 'react-redux';
  import { AppRegistry} from 'react-native';
  import { createStackNavigator} from &quot;react-navigation-stack&quot;;
  //import { StackNavigator } from 'react-navigation';
  import { createAppContainer } from 'react-navigation';
  import App from './src/App';
  import configureStore from './src/store/index';
  import TagDetail from './src/component/TagDetail';
  import FeedDetail from './src/component/FeedDetail';
  import UserDetail from './src/component/UserDetail';
  import SettingsPage from './src/SettingsPage';
  import About from './src/About';
  
  
  import {name as appName} from './app.json';
  
  const store = configureStore();
  
  
  const AppNavigator = createStackNavigator({
    Home: {
      screen: App
    },
    TagDetail: {
      screen: TagDetail
    },
    FeedDetail: {
      screen: FeedDetail
    },
    UserDetail: {
      screen: UserDetail
    },
    SettingsPage: {
      screen: SettingsPage
    },
    AboutPage: {
      screen:About
    }
  },{
    headerMode: 'none'
  });
  
  
  export default class Root extends Component {
    render() {
      return (
        &lt;Provider store={store}&gt;
          &lt;Apps/&gt;
        &lt;/Provider&gt;
      )
    }
  }
  
  
  AppRegistry.registerComponent(appName, () =&gt; Root);
  
  const Apps = createAppContainer(AppNavigator);
  //export default Apps;
  
  </code></pre>
  <p>package.json</p>
  <pre><code>{
    &quot;name&quot;: &quot;TestApp&quot;,
    &quot;version&quot;: &quot;0.0.1&quot;,
    &quot;private&quot;: true,
    &quot;scripts&quot;: {
      &quot;android&quot;: &quot;react-native run-android&quot;,
      &quot;ios&quot;: &quot;react-native run-ios&quot;,
      &quot;start&quot;: &quot;react-native start&quot;,
      &quot;test&quot;: &quot;jest&quot;,
      &quot;lint&quot;: &quot;eslint .&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@react-native-community/async-storage&quot;: &quot;^1.11.0&quot;,
      &quot;@react-native-community/masked-view&quot;: &quot;^0.1.10&quot;,
      &quot;@react-native-community/viewpager&quot;: &quot;^4.0.0&quot;,
      &quot;aws-sdk&quot;: &quot;^2.693.0&quot;,
      &quot;lodash&quot;: &quot;^4.17.15&quot;,
      &quot;lodash.debounce&quot;: &quot;^4.0.8&quot;,
      &quot;react&quot;: &quot;16.13.1&quot;,
      &quot;react-native&quot;: &quot;^0.64.1&quot;,
      &quot;react-native-deprecated-custom-components&quot;: &quot;^0.0.0&quot;,
      &quot;react-native-gesture-handler&quot;: &quot;^1.10.0&quot;,
      &quot;react-native-image-crop-picker&quot;: &quot;^0.31.1&quot;,
      &quot;react-native-image-picker&quot;: &quot;^2.3.1&quot;,
      &quot;react-native-keyboard-spacer&quot;: &quot;^0.4.1&quot;,
      &quot;react-native-material-menu&quot;: &quot;^1.2.0&quot;,
      &quot;react-native-navbar&quot;: &quot;^2.1.0&quot;,
      &quot;react-native-parallax-scroll-view&quot;: &quot;^0.21.3&quot;,
      &quot;react-native-photo-view&quot;: &quot;^1.5.2&quot;,
      &quot;react-native-safe-area-context&quot;: &quot;^3.0.2&quot;,
      &quot;react-native-screens&quot;: &quot;^2.8.0&quot;,
      &quot;react-native-scrollable-tab-view&quot;: &quot;^1.0.0&quot;,
      &quot;react-native-swiper&quot;: &quot;^1.6.0-rc.1&quot;,
      &quot;react-native-tab-navigator&quot;: &quot;^0.3.4&quot;,
      &quot;react-native-text-ticker&quot;: &quot;^1.5.0&quot;,
      &quot;react-native-vector-icons&quot;: &quot;^8.1.0&quot;,
      &quot;react-native-vertical-view-pager&quot;: &quot;^0.1.1&quot;,
      &quot;react-native-video&quot;: &quot;^4.4.5&quot;,
      &quot;react-native-view-pager&quot;: &quot;^0.2.3&quot;,
      &quot;react-navigation&quot;: &quot;^4.3.9&quot;,
      &quot;react-navigation-stack&quot;: &quot;^2.6.0&quot;,
      &quot;react-redux&quot;: &quot;^5.0.6&quot;,
      &quot;redux&quot;: &quot;^3.7.2&quot;,
      &quot;redux-thunk&quot;: &quot;^2.2.0&quot;,
      &quot;styled-components&quot;: &quot;^5.1.1&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/core&quot;: &quot;^7.10.2&quot;,
      &quot;@babel/runtime&quot;: &quot;^7.10.2&quot;,
      &quot;@react-native-community/eslint-config&quot;: &quot;^1.1.0&quot;,
      &quot;babel-jest&quot;: &quot;^26.0.1&quot;,
      &quot;eslint&quot;: &quot;^7.2.0&quot;,
      &quot;jest&quot;: &quot;^26.0.1&quot;,
      &quot;metro-react-native-babel-preset&quot;: &quot;^0.59.0&quot;,
      &quot;react-test-renderer&quot;: &quot;16.13.1&quot;
    },
    &quot;jest&quot;: {
      &quot;preset&quot;: &quot;react-native&quot;
    }
  }
  
  
  </code></pre>
  <p>app.json</p>
  <pre><code>{
    &quot;name&quot;: &quot;TestApp&quot;,
    &quot;displayName&quot;: &quot;TestApp&quot;
  }
  </code></pre>