Application MyTest has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.

运行react-native项目时报错。

说明一下:项目本来是好的,再次运行就报错了

解决解决办法倒是有,不过具体什么原因不知道。希望有知道具体原因的童鞋能够补充一下

第一种情况:真的是注册的时候写错了。也就是这段话注册的不对:

AppRegistry.registerComponent(‘MyDemo‘, () => MyDemo);

注意:‘MyDemo’这个是项目名 MyDemo这个你可以随自己你喜好指定。

第二种情况:也就是其他情况,你感觉什么都是好的但是运行起来还是会报这个错误。那么很有可能是8081端口被占用了

你可以尝试:切换到项目所在目录,输入react-native start 如果出现Packager can‘t listen on port 8081那说明端口被占用了。

根据命令行提示进行操作:

1.lsof -n -i4TCP:8081    列出被占用的端口列表

2.kill -9 <PID>    找到与之对应的PID然后删除即可

3.重新运行项目 react-native run-ios/android

打完收工

时间: 2024-08-26 07:16:16

Application MyTest has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.的相关文章

NT_iOS笔记—提交报错:unable to process application at this time due to the following error

打好包提交验证的时候报错了: unable to process application at this time due to the following error:The IPA is invalid.it does not include a payload directory : 解决方法: 修改info.plist Application requires iPhone environment |  Boolean | Yes Clean Build Archive

ReactNative For Android 框架启动核心路径剖析

版权声明:本文由王少鸣原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/144 来源:腾云阁 https://www.qcloud.com/community 前面给大家分析过 ReactNative For Android (RN4A) 的通信机制,这次我们从源码出发,分析下RN4A的启动过程.启动过程基于通信机制,涉及通信机制原理大家可以查看前一篇文章,本篇不赘述. 上面是2016 React.js Conf FB 工

React-Native坑:Invariant Violation:Application 项目名 has not been registered.

前言 在学习一门新技术的你也许有跟我一样的困惑,照着书上或者视频上的敲了.但是就是有各种问题没有出来自己想要的结果.我会将自己在这个过程中遇到的坑都记录下来,不一定全覆盖,但希望这些文章可以解决你的问题.   错误提示 Invariant Violation:Applicaction 项目名 has not been registered.This is either due to a require() error during initialization or failure to cal

Convert Application Model Differences

The eXpressApp Framework is based on the modules concept. As a rule, every module implements a certain feature. Entities implemented in a module, such as persistent classes or extra Application Model nodes - can be customized by users of the applicat

Examining Application Startup in ASP.NET 5

By Steve Smith  June 23, 2015 ASP.NET 5 differs from previous versions of ASP.NET in many ways. Gone is the default ASP.NET event life cycle, and along with it, the global.asax file (which itself was an evolved version of global.asa from the ASP days

Fix Visual Studio 2013 Razor CSHTML Intellisense in Class Library or Console Application

https://mhusseini.wordpress.com/2015/02/05/fix-visual-studio-2013-razor-cshtml-intellisense-in-class-library-or-console-application/ I tried to use a .cshtml file and the razor syntax in a console application. I was able to build the project, but the

Unit Testing a zend-mvc application

Unit Testing a zend-mvc application A solid unit test suite is essential for ongoing development in large projects, especially those with many people involved. Going back and manually testing every individual component of an application after every c

How to update WPF browser application manifest and xbap file with ‘mage.exe’

老外参考文章1 老外参考文章2 I created a WPF browser application MyApp then published it by ClickOnce in VS2008. Published folder like this: PublishedFolder\MyApp.xbap PublishedFolder\setup.exe PublishedFolder\Application Files\MyApp_0_0_0_1\ MyApp.xbap Published

Demystifying iOS Application Crash Logs

http://www.raywenderlich.com/23704/demystifying-ios-application-crash-logs This is a blog post by Soheil Moayedi Azarpour, an independent iOS developer. You can also find him on Google+. Have you ever had the following experience as an app developer?