React-Native: AppRegistry module is not a registered called module

I am currently trying to run ES6 response-native-webpack-server on an Android emulator. The difference is that I updated my package.json and build.grade to use the 0.18.0 reaction, and I get this error while loading. As far as I know, AppRegistry imported correctly. Even if I commented on the code, this error still occurs. It really works on iOS without a problem.

What am I doing wrong?

EDIT: after using other templates supporting 0.18.0, I am still facing the same problem.

enter image description here

+100
android webpack react-native
Jan 23 '16 at 22:44
source share
17 answers

I just updated to react-native 0.18.1 today, when he was having problems with independent experts with version 0.19.0-rc .

Let's get back to your question, what have I done.

  • cd android
  • sudo ./gradlew clean

then go back to the working directory and run react-native run-android

you must restart your npm too after this update.

hope this works for you.

+45
Jan 26 '16 at 13:17
source share

I had the same problem on iOS, and the reason for me was that my index.ios.js was incorrect (because I copied one of the examples without looking at its contents), it ended with a module export declaration

 exports.title = ... exports.description = ... module.exports = MyRootComponent; 

Instead of the expected

 AppRegistry.registerComponent('MyAppName', () => MyRootComponent); 

I think you might have the same problem on Android with index.android.js.

+14
Mar 18 '16 at 23:26
source share

One of the main causes of this problem may be that you installed the plugin and forgot to link it .

try this:

 react-native link 

Restart your application.

Hope this helps. Please let me know in the comments . Thank you

+11
Aug 23 '18 at 9:49
source share

I solved this problem by simply adding

 import { AppRegistry } from "react-native"; import App from "./App"; import { name as appName } from "./app.json"; AppRegistry.registerComponent(appName, () => App); 

to my index.js

make sure it exists in your index.js

+7
Jul 24 '18 at 7:38
source share

Hope this can save someone a headache. I got this error after updating my reactive version. Vaguely, it only appeared on the Android side.

My file structure has index.ios.js and index.android.js . Both contain code:

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

What I needed to do, in android/app/src/main/java/com/{projectName}/MainApplication.java , change index to index.android :

 @Override protected String getJSMainModuleName() { return "index.android"; // was "index" } 

Then in app/build/build.gradle change entryFile from index.js to index.android.js

 project.ext.react = [ entryFile: "index.android.js" // was index.js" ] 
+3
Feb 19 '18 at 20:43
source share

I don't know why, but when I move AppRegistry.registerComponent from the index.js file, which is included in index.android.js, to be directly inside index.android.js, it works.

+2
Feb 25 '16 at 14:27
source share

For me, my problem was when inserting the wrong input file .

I used App.js as my input file, so App could not find AppRegistry

Right:

 react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ 

Wrong:

 react-native bundle --platform android --dev false --entry-file App.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ 
+2
Jun 12 '18 at 20:09
source share

If you use some of the examples, they may not work.

Here is my scroll view version

 /** * Sample React Native App * https://github.com/facebook/react-native */ import React, { AppRegistry, Component, StyleSheet, Text, View, ScrollView, TouchableOpacity, Image } from 'react-native'; class AwesomeProject extends Component { render() { return ( <View> <ScrollView ref={(scrollView) => { _scrollView = scrollView; }} automaticallyAdjustContentInsets={false} onScroll={() => { console.log('onScroll!'); }} scrollEventThrottle={200} style={styles.scrollView}> {THUMBS.map(createThumbRow)} </ScrollView> <TouchableOpacity style={styles.button} onPress={() => { _scrollView.scrollTo({y: 0}); }}> <Text>Scroll to top</Text> </TouchableOpacity> </View> ); } } var Thumb = React.createClass({ shouldComponentUpdate: function(nextProps, nextState) { return false; }, render: function() { return ( <View style={styles.button}> <Image style={styles.img} source={{uri:this.props.uri}} /> </View> ); } }); var THUMBS = [ 'http://loremflickr.com/320/240?random='+Math.round(Math.random()*10000) + 1, 'http://loremflickr.com/320/240?random='+Math.round(Math.random()*10000) + 1, 'http://loremflickr.com/320/240?random='+Math.round(Math.random()*10000) + 1 ]; THUMBS = THUMBS.concat(THUMBS); // double length of THUMBS var createThumbRow = (uri, i) => <Thumb key={i} uri={uri} />; var styles = StyleSheet.create({ scrollView: { backgroundColor: '#6A85B1', height: 600, }, horizontalScrollView: { height: 120, }, containerPage: { height: 50, width: 50, backgroundColor: '#527FE4', padding: 5, }, text: { fontSize: 20, color: '#888888', left: 80, top: 20, height: 40, }, button: { margin: 7, padding: 5, alignItems: 'center', backgroundColor: '#eaeaea', borderRadius: 3, }, buttonContents: { flexDirection: 'row', width: 64, height: 64, }, img: { width: 321, height: 200, } }); AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); 
+1
Apr 19 '16 at 7:54 on
source share

I deleted it on Genymotion. Then run react-native run-android to create the application. And it worked. Try this earlier before running sudo ./gradlew clean , it will save you a lot of time.

+1
Oct 15 '17 at 11:57
source share

To just restart the computer, they fixed it. (My mistake was: "the appRegistry module is not a registered module called (runapplication calling) js engine: hermes")

Another main answer, which is missing here and could work, was simply to kill the host processes:

killall -9 node

[ Module AppRegistry is not a registered called module (calling runApplication) ]

+1
Sep 04 '19 at 13:08
source share

In my case, my index.js just points to another js instead of my Launcher js mistakenly, which does not contain AppRegistry.registerComponent() .

So, make sure the index.js file points to the registration of the class.

0
Mar 21 '18 at 23:47
source share

My problem was fixed by increasing my inotify max_user_watches:

 sudo sysctl fs.inotify.max_user_watches=1280000 
0
Apr 27 '18 at 19:49
source share

For me, this was a problem with a reaction-dependent dependency on the next version of the reaction package, while the old one was specified in my package.json. Upgrading my reactive version solved this problem.

0
Jun 01 '18 at 18:58
source share

For me, I’m just connected with reacting native, like this way: reaction-native link

0
Jan 10 '19 at 17:11
source share

The restart packer worked for me. just kill the responsive native packer and run it again.

0
Jun 24 '19 at 15:01
source share

if you encounter this error on windows with android

open the root directory application folder and go to the Android folder.

  cd android gradlew clean 

launch the application again react native run android

although it works

0
Sep 27 '19 at 13:00
source share

npm start - --reset-cache

The port may already be in use. I encounter a similar problem when I first launch the reagent-native android launch and then launch npm. I solve it this way: first, get the identifier of the process running on port 8081: sudo lsof -i: 8081

0
Oct 03 '19 at 6:42
source share



All Articles