Module AppRegistry is not registered callable module (calling runApplication)

React NativeNative Base

React Native Problem Overview


I am using native base for making app in react-native. I am new to both things. When I run the app It gives me this error:

enter image description here

Here is my code:

export default class Point extends Component {

    render() {
        return (
            <Container>
                <Header>
                    <Left>
                        <Button transparent>
                            <Icon name='menu' />
                        </Button>
                    </Left>
                    <Body>
                        <Title>Header</Title>
                    </Body>
                    <Right />
                </Header>
            </Container>
        );
    }
}

Here is the screenshot of my versions

enter image description here

and nativebase version is "native-base": "^2.1.2"

React Native Solutions


Solution 1 - React Native

Just kill all node process and start npm server and run application:

Step1: run command killall -9 node

> For windows users, run: taskkill /im node.exe > > Run taskkill /f /im node.exe if the process still persists.

Step2: run command npm start --reset-cache

Step3: run command react-native run-ios OR react-native run-android

Solution 2 - React Native

Closing the current Metro Bundler and restarting by resetting the cache worked for me

npm start -- --reset-cache

Solution 3 - React Native

react-native start --reset-cacher

Solution 4 - React Native

You should have this at the bottom of the index.ios.js file AppRegistry.registerComponent('Point', () => Point); and also import AppRegistry from react-native

Solution 5 - React Native

I had this issue - it was odd because I reset my repo to a time when the app was working. The issue was with my simulator (iOS).

For me the solution was to

  1. kill the simulator program (quit)
  2. then - close the terminal window that is opened when simulator is ran (Metro Bundler) Image of my terminal window

Solution 6 - React Native

Close the current Metro Bundler and restart by typing the comment:

npm start -- --reset-cache

Solution 7 - React Native

Stop the node server running and run 'react-native run-ios' once again.

Solution 8 - React Native

I tend to get this error after I install a new package that has some native code that needs to be installed with it. Usually packages will say install npm module and then install native code via a pod install (ios specific) and after this my app usually throws this error.

In order to get rid of this error I delete and reinstall node_modules and pods since I am making an iOS app and then I also delete the build folder under ios. After that I run the packager with npm start -- --reset-cache and build my app again using the react-native run-ios command. This fixes the issue for me.

Solution 9 - React Native

Worked for me for below version and on iOS:

"react": "16.9.0",
"react-native": "0.61.5",

Step to resolve
Close the current running Metro Bundler
Try Re-run your Metro Bundler and check if this issue persists

Solution 10 - React Native

In my case, trying npm start -- --reset-cache and getting a bunch more errors, I deleted (uninstalled) the app from iOS and Android and yarn ios yarn android did the trick.

Solution 11 - React Native

I was using native base for my app here is link [native base][1]

and you can see there is no app registry like this

 AppRegistry.registerComponent('Point', () => Point) 

but i have to do this to run my app [1]: https://docs.nativebase.io/Components.html#Components

Solution 12 - React Native

Just closing the metro bundler and rebuilding the app done my job.

Solution 13 - React Native

  1. Close Emülator

  2. npm start -- --reset-cache

  3. XCode -> Product -> Clean Build Folder

  4. npx react-native run-ios

Solution 14 - React Native

I tried killall -9 node command in terminal

then again i run my project using npm start and it's working fine

Solution 15 - React Native

I ended up creating an entirely new react-native project after a computer restart and after the deletion/rebuild of the npm_modules folder, Pods folder, and my ios build folder did not work. (Quitting the Simulator, Quitting the Terminal app, Quitting XCode, cleaning the project folder in XCode, and running killall -9 node, npm start -- reset-cahce & npm start -- --reset-cache did not work, either). After installing all my packages, I copied and pasted my code from my old project to the new one. Same error. So then I started backtracking my most recent code changes, step by step. After reverting my most recent code changes, it worked. While adding new code little by little, I got an error telling me I forgot to import {StyleSheet} from 'react-native';. I imported that, then continued adding my code that had previously led to the error (which was simply a react-native-elements Button and a StyleSheet const styles). All went well.

So, in the end, my only theory is that I had added too much code at once, and instead of telling me I forgot to import {StyleSheet} like it should have, it instead threw me a vague and infuriating module AppRegistry error.

Solution 16 - React Native

Need to replace

.setJSMainModulePath("index") with .setJSMainModulePath("index.android")

Solution 17 - React Native

If you are using windows and running yarn open cmd on admin mode' terminate and Restart the node process by typing this command.

Find the node: killall -9 node force to kill : taskkill /f /im node.exe Reset the cache : yarn start --reset-cache

Navigate to your project directory: cd myapp Re-Run your App : yarn android

Solution 18 - React Native

In my case, I didn't import a module in a component that I was using it in.

So, just check if you are importing the module you want to use...

Solution 19 - React Native

One of the libraries has not been linked. To check, just comment out in the package.json one by one the latest libraries added.

yarn remove libraryName.

Then run the app with xcode and puf !

Solution 20 - React Native

If your are building a new npm module and this rely on some other dependencies already added in your project, you need to add those dependencies in the package.json of the npm package as peer dependency.

package.json

"peerDependencies":{
 "@org/your-dependency":">= 1.2.0"
}
[Tue Aug 31 2021 17:57:45.731]  ERROR    Error: Type oid already present, js engine: hermes
[Tue Aug 31 2021 17:57:45.732]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication), js engine: hermes
[Tue Aug 31 2021 17:57:45.732]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication), js engine: hermes

Solution 21 - React Native

For me, the issue was starting the metro bundler when there was an error in one of my styles. I had an error in my code from last night, and then my computer did a restart overnight. Trying to start everything up today resulted in this error along with Invariant Violation: Invalid prop 'position' of value 'fixed' supplied to. Fixing the position value resolved both errors.

Solution 22 - React Native

One single error but there might be multiple causes. Seeing a lot of diverse discussions in the community means this issue could be hard to find. Try to proceed with the following.

  1. There might be a missing import.
  2. There might be a missing configuration with the library you recently installed.
  3. You may not receive errors in Android but in IOS. Then one of the lib configurations in IOS is missing.
  4. Your cache needs to be reset if RN is upgraded.

If you still cannot find the issue with the above, remove some imports or screens from your App.js. Going with this you can find what exactly caused this error. This is how I found my issue after a day of research.

Click to see further Github issues

Solution 23 - React Native

closing your current metro bundle and run this :--

npm start -- --reset-cache

Solution 24 - React Native

For me, restarting my computer appears to be enough to clear this issue.

It's often required after I've switched between branches, or merged branches using git.

Solution 25 - React Native

This happens for one of these reasons:-

  • Either, your app's entry file 'index.js' is corrupt due to syntax error or your React App could not load.
  • Your Metro Bundler instance running is stale and corrupt.

Solution

  • Terminate already running Metro Bundler instance

  • Reset Cache

    react-native start --reset-cache
    
  • Delete android/app/bulid folder

  • Start server again

Solution 26 - React Native

The solution is very simple just kill all the running nodes and restart your node server and rebuild your native application and it works.

For Linix:

killall -9 node

For Windows:

taskkill /im node.exe

For Android native App:

react-native run-android 

For IOS native App:

react-native run-ios

Then finally,

npm start

Solution 27 - React Native

I was also suffering from the same error for windows OS. I resolved this by cleaning gradlew.

The steps are:

  1. cd android
  2. gradlew clean
  3. cd..

Solution 28 - React Native

> npm start -- --reset-cache > > react-native run-ios > works for me.

Solution 29 - React Native

import { AppRegistry } from 'react-native';
            
AppRegistry.registerComponent('your app name',  () => point);

Solution 30 - React Native

You just need to close the metro server by control + c and then restart by npm start --reset-cache

Note: If that too doesn't work then just restart your computer, it'll definitely work then.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAsadView Question on Stackoverflow
Solution 1 - React NativeBrijesh ShiroyaView Answer on Stackoverflow
Solution 2 - React NativeChetan J RaoView Answer on Stackoverflow
Solution 3 - React NativeAmit Kumar TrivediView Answer on Stackoverflow
Solution 4 - React NativeChiamaka NwolisaView Answer on Stackoverflow
Solution 5 - React Nativet.iosView Answer on Stackoverflow
Solution 6 - React NativeSocheat YornView Answer on Stackoverflow
Solution 7 - React NativecherucoleView Answer on Stackoverflow
Solution 8 - React NativeJoseView Answer on Stackoverflow
Solution 9 - React NativesahuView Answer on Stackoverflow
Solution 10 - React NativeZhengqian KuangView Answer on Stackoverflow
Solution 11 - React NativeAsadView Answer on Stackoverflow
Solution 12 - React NativeSiraj AlamView Answer on Stackoverflow
Solution 13 - React NativeFigen ÇetinView Answer on Stackoverflow
Solution 14 - React NativeLakshya TyagiView Answer on Stackoverflow
Solution 15 - React NativevelkoonView Answer on Stackoverflow
Solution 16 - React NativeAristo MichaelView Answer on Stackoverflow
Solution 17 - React NativejeremiahView Answer on Stackoverflow
Solution 18 - React NativeFilip SavicView Answer on Stackoverflow
Solution 19 - React NativeRuben MimView Answer on Stackoverflow
Solution 20 - React NativeIvan CabreraView Answer on Stackoverflow
Solution 21 - React NativeJohn HardingView Answer on Stackoverflow
Solution 22 - React NativeSabri MevişView Answer on Stackoverflow
Solution 23 - React NativeMithpansView Answer on Stackoverflow
Solution 24 - React NativeHarry BView Answer on Stackoverflow
Solution 25 - React NativeillusionistView Answer on Stackoverflow
Solution 26 - React NativeHardik SharmaView Answer on Stackoverflow
Solution 27 - React NativePrakash Kumar SinghView Answer on Stackoverflow
Solution 28 - React NativeMenon HasanView Answer on Stackoverflow
Solution 29 - React Nativefazeel haiderView Answer on Stackoverflow
Solution 30 - React NativeAamir Hussain PadderView Answer on Stackoverflow