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 ...
随机推荐
- Qt 5.3.1 版本应用程序的发布问题
问题描述:用过Qt的朋友,都知道,完成的Qt程序,只能在QT环境里运行.在debug环境里,没有配置环境路线的情况下,必须包含多个dll库,然而每个dll库的大小确实很大的.但有时候还是会失败的,在一 ...
- Spring AOP(配置文件方式)
spring配置文件: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="h ...
- Atitit.mvc的趋势与未来attilax总结
Atitit.mvc的趋势与未来attilax总结 1. Mvc的分类 (服务端mvc vs客户端mvc)1 2. Mvc的趋势,从服务端mvc正在转向客户端mvc1 2.1. 更加完善的分离..h ...
- node.js cluster多进程、负载均衡和平滑重启
1 cluster多进程 cluster经过好几代的发展,现在已经比较好使了.利用cluster,可以自动完成子进程worker分配request的事情,就不再需要自己写代码在master进程中rob ...
- 我所理解的JavaScript闭包
目录 一.闭包(Closure) 1.1.什么是闭包? 1.2.为什么要用闭包(作用)? 1.2.1.保护函数内的变量安全. 1.2.2.通过访问外部变量,一个闭包可以暂时保存这些变量的上下文环境,当 ...
- iframeWin For Easy UI. 为 Easy UI 扩展的支持IFrame插件
iframeWin For Easy UI. 为 Easy UI 扩展的支持IFrame插件 在一个项目中用了Easy UI,但是发现里面的 Dialog .Window.Messager 弹窗都不支 ...
- Linux录屏软件
如何查找录屏软件 apt-cache search screen record libutempter-dev - privileged helper for utmp/wtmp updates (d ...
- AngularJS datepicker 和 datatimepicker
本文内容 项目结构 AngularJS datepicker AngularJS+jQueryUI datetimepicker 本文介绍 AngualrJS datetimepicker 控件.说明 ...
- mac os 中安装memcahed
1.先安装macport sudo port selfupdate #更新当前Marport (如果port 不可以时可以考虑此操作) sudo prot -d selfupdate #替换更 ...
- android 透明度颜色值
100% — FF99% — FC98% — FA97% — F796% — F595% — F294% — F093% — ED92% — EB91% — E890% — E689% — E388% ...