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
打完收工
Application MyTest has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.的更多相关文章
- ReactNative bug:Application XXX has not bean registered.
故障现象 当react-native init新项目之后运行react-native run -android/ios时手机报错 Application XXX has not bean regist ...
- React Native 常见问题集合
在使用React Native时候,我记录下比较常遇到的问题,分为以下几类: 1. 调试问题 2. 写法问题 3. 疑难问题 4. 奇怪问题 调试问题 1. 在react-native run-and ...
- ReactNative For Android 框架启动核心路径剖析
版权声明:本文由王少鸣原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/144 来源:腾云阁 https://www.qclo ...
- React-Native坑1:Invariant Violation:Application 项目名 has not been registered.
React-Native坑1:Invariant Violation:Application 项目名 has not been registered. 字数347 阅读1421 评论3 喜欢7 前言 ...
- React-Native坑:Invariant Violation:Application 项目名 has not been registered.
前言 在学习一门新技术的你也许有跟我一样的困惑,照着书上或者视频上的敲了.但是就是有各种问题没有出来自己想要的结果.我会将自己在这个过程中遇到的坑都记录下来,不一定全覆盖,但希望这些文章可以解决你的问 ...
- React Native 之 main.jsbundle生成方法
通过react-native init yooweiProject 生成的RN项目(版本基于0.57),目录结构如下 项目结构: 大家可以发现main.jsbundle 是红色的,不存在的,这个属于正 ...
- ReactNative: 使用AppReistry注册类
一.简介 每一个应用程序的运行都有一个入口文件或者入口函数,例如iOS中的使用UIApplicationMain类完成入口函数的实现,在React-Native中,AppRegistry类就肩负着这个 ...
- Spring boot 全局配置文件application.properties
#更改Tomcat端口号 server.port=8090 #修改进入DispatcherServlet的规则为:*.htmlserver.servlet-path=*.html#这里要注意高版本的s ...
- [Windows Azure] Adding Sign-On to Your Web Application Using Windows Azure AD
Adding Sign-On to Your Web Application Using Windows Azure AD 14 out of 19 rated this helpful - Rate ...
随机推荐
- [RabbitMQ] Connection failed
RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachabl ...
- Bean的作用域及生命周期
指定bean的作用域通过scope属性 singleton单实例模式,从初始化容器就初始化bean,除非延迟初始化lazy-init=true prototype每次从容器获取bean是新的对象,从g ...
- AT&T ASSEMBLY FOR LINUX AND MAC (SYS_FORK)
Fork() in C: (sys_fork.c) #include <stdio.h> #include <stdlib.h> #include <unistd.h&g ...
- atitit.dw不能显示正确的百分比高度in dw的解决
atitit.dw不能显示正确的百分比高度in dw的解决 div 设置35%的高度,三,不能正确的显示高度...环境dw cs6 但是设置161px奏能ok了...表明这个是dw的一个bug... ...
- 每天一个linux命令(6):rmdir 命令
今天学习一下linux中命令: rmdir命令.rmdir是常用的命令,该命令的功能是删除空目录,一个目录被删除之前必须是空的.(注意,rm - r dir命令可代替rmdir,但是有很大危险性.)删 ...
- Java日期与时间的处理/Date,String,Calendar转换
public class Demo01 { //Java中Date类和Calendar简介 public static void main(String[] args) { long now=Syst ...
- python两个文件的对比
#encoding=utf-8 class SyncPagemaptoDB(object): def loadOldmap(self,oldpage,newpage,new_version): map ...
- libuv在cocos2d-x中的使用
libuv经过Node.js的实践和应用,已经证明非常之成熟,本来之前项目用的是这个:clsocket https://github.com/DFHack/clsocket 当初选它的主要原因是它支 ...
- WindowsPhone-GameBoy模拟器开发五--使用XNA初略实现Gameboy显示系统
开篇前,最近弄了个空间,大家不嫌弃的话可以上去讨论讨论J http://www.lihengzhe.cn 这一次,就来简单地实现gameboy的实现机制.先说一下本次内容涉及到的技术,其实也就一项—X ...
- ubuntu 16.04 有道词典
依赖环境 sudo apt install \ python3-pyqt5 \ python3-requests \ python3-xlib \ python3-pil \ tesseract-oc ...