React-native Pit: Invariant violation:application project name has not been registered.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.