Objective
In learning a new technology you may have the same confusion as I do, according to the book or video knock. But there are all kinds of problems that don't come out the way you want. I will record the pits I have encountered in this process, not necessarily full coverage, but I hope these articles can solve your problem.
Error Hints
Invariant Violation:applicaction project name has not been registered. This was either due to a require () error during initialization or failure to call appregistry.registercommponent.
The root cause of this error is rooted directory./index.android.js
Appregistry.registercomponent (' Project name ', () = ...);
With the./ios/Project name in/APPDELEGATE.M
Rctrootview*rootview = [[Rctrootviewalloc]initwithbundleurl:jscodelocation
modulename:@ "project name" Launchoptions:launchoptions];
Or./android/app/src/main/java/com/in the project name/mainactivity.java
Mreactrootview.startreactapplication (Mreactinstancemanager, "project name", NULL);
Without consistency, the workaround is simple. Edit the same parameters.
However, there is another situation!
Even if you're sure you're consistent, but you still have the same error message, what's the problem? You can check your command line at this time. It's possible that you're running more than one program at the same time, like me. If your react-native is running program A and you open program B, the same problem will occur. The workaround is simple, turn off the command line and run the program. CTRL + C, run the program you want to run.
React-native Pit: Invariant violation:application project name has not been registered.