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:
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
and nativebase version is "native-base": "^2.1.2"
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.exeRun
taskkill /f /im node.exeif the process still persists.
Step2: run command npm start --reset-cache
Step3: run command react-native run-ios OR react-native run-android
Closing the current Metro Bundler and restarting by resetting the cache worked for me
npm start -- --reset-cache
You should have this at the bottom of the index.ios.js file
AppRegistry.registerComponent('Point', () => Point);
and also import AppRegistry from 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
- kill the simulator program (quit)
- then - close the terminal window that is opened when simulator is ran (Metro Bundler) Image of my terminal window
I was using native base for my app here is link native base
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
Need to replace
.setJSMainModulePath("index") with .setJSMainModulePath("index.android")
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.
I am using Expo
In my case, I resolved the issue by adding the following code in app.json file
"expo":{
...
"android": {
"package": "com.mycompanyname.myappname
}
}
import { AppRegistry } from 'react-native';
AppRegistry.registerComponent('your app name', () => point);
来源:https://stackoverflow.com/questions/43604603/module-appregistry-is-not-registered-callable-module-calling-runapplication

