Run React-native project times wrong.
Note: The project was originally good, again run the error
There is a solution, but I don't know what the reason is. I would like to have children's shoes that know the specific reasons to add
The first case: it's really the wrong time to register. This is the wrong thing to register:
Appregistry.registercomponent (' Mydemo ', () = Mydemo);
Note: ' Mydemo ' This is the project name Mydemo this you can specify with your preference.
The second situation: in other cases, you feel that everything is good, but running up will still report the error. Well, there's a good chance that port 8081 is occupied.
You can try: switch to the directory where the project is located, enter react-native start if the packager can ' t listen on port 8081 that indicates that the port is occupied.
Follow the instructions on the command prompt:
1.lsof-n-i4tcp:8081 List of occupied ports
2.kill-9 <PID> Find the corresponding PID and delete it.
3. Re-run the project React-native run-ios/android
Finish the call.
Application MyTest have not been registered. This was either due to a require () error during initialization or failure to call appregistry.registercomponent.