React-Native坑1:Invariant Violation:Application 项目名 has not been registered.
React-Native坑1: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 call AppRegistry.registerCommponent.
这个错误的根本原因是根目录./index.ios.js中
AppRegistry.registerComponent('项目名',() => ...);
与./ios/项目名/appDelegate.m中的
RCTRootView*rootView = [[RCTRootViewalloc]initWithBundleURL:jsCodeLocation
moduleName:@"项目名" launchOptions:launchOptions];
或是./android/app/src/main/java/com/项目名/MainActivity.java中的
mReactRootView.startReactApplication(mReactInstanceManager, "项目名", null);
没有保持一致,解决方法很简单。编辑成相同的参数即可。
但是,还有一种情况!
即
便你确保一致了但还是出现相同的错误提示,这又是怎么搞得呢?这个时候你可以检查一下你的命令行。有可能你同时在运行一个以上的程序,像我。如果你的
react-native在运行程序A而你打开了程序B,也会出现相同的问题。解决方法很简单,关掉命令行运行程序。ctrl+c,运行你想运行的程序。
React-Native坑1:Invariant Violation:Application 项目名 has not been registered.的更多相关文章
- React-Native坑:Invariant Violation:Application 项目名 has not been registered.
前言 在学习一门新技术的你也许有跟我一样的困惑,照着书上或者视频上的敲了.但是就是有各种问题没有出来自己想要的结果.我会将自己在这个过程中遇到的坑都记录下来,不一定全覆盖,但希望这些文章可以解决你的问 ...
- React Native开源项目案例
(六).React Native开源项目: 1.Pober Wong_17童鞋为gank.io做的纯React Native项目,开源地址:https://github.com/Bob1993/Rea ...
- Wait… What Happens When my React Native Application Starts? — An In-depth Look Inside React Native
Discover how React Native functions internally, and what it does for you without you knowing it. Dis ...
- React Native 开源项目汇总
最近闲来无事,学习了React Native开发Android APP,自我感觉RN APP的效果和Native APP比还是蛮不错,以下是找到的一些优秀源码,仅供学习参考... React Nati ...
- React Native环境配置、初始化项目、打包安装到手机,以及开发小知识
1.前言 环境:Win10 + Android 已经在Windows电脑上安装好 Node(v14+).Git.Yarn. JDK(v11) javac -version javac 11.0.15. ...
- 深入浅出React Native 2: 我的第一个应用
这是深入浅出React Native教程的第二篇文章. 1. 环境配置 React Native环境配好之后,就可以开始创建我们的第一个App啦. 打开控制台,输入 react-native init ...
- react native与现有的应用程序集成
(1)通过cocopods 集成 ,以下内容 参考 http://wiki.jikexueyuan.com/project/react-native/integration-existing.html ...
- React Native专题
转载注明出处:地址:http://www.lcode.org本文出自:[江清清的技术专栏]本React Native讲解专题:主要讲解了React Native开发,由基础环境搭建配置入门,基础,进阶 ...
- taro之React Native 端开发研究
初步结论:如果想把 React Native 集成到现有的原生项目中,不能使用taro的React Native 端开发功能(目前来说不能实现,以后再观察). RN开发有2种模式: 1.一是原生A ...
随机推荐
- Bluetooth LMP介绍
目录 1. 介绍 2. 数据包格式(Packet Format) 3. Procedure Rules 4. 通用回应消息(General Response Messages) 5. 设备特性(Dev ...
- qmake理解(还可以加入Lex Yacc文件)
关于qmake,好一段时间令我一头雾水,不知道用来干嘛的,只知道怎么用,而且也只懂那么一两个命令,详细看过资料以后整理如下: 1.首先,感性的认识是,qmake可以利用源文件(包括头文件h,实现文件c ...
- C#中string.Empty ,"" , null 区别
引言 String类型作为使用最频繁的类型之一,相信大家都非常熟悉,对于string赋予空值,通常有以下三种方式: String str1=null; String str2=””; String s ...
- [LeetCode] Longest Palindromic Substring(manacher algorithm)
Given a string S, find the longest palindromic substring in S. You may assume that the maximum lengt ...
- 创建第一个ArcGIS API for Silverlight应用
原文:创建第一个ArcGIS API for Silverlight应用 在完成前面的开发环境搭建以后,接下来实现我们的第一个ArcGIS API forSilverlight应用程序. 接下来我们一 ...
- [LeetCode]题解(python):80-Remove Duplicates from Sorted Array II
题目来源 https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/ Follow up for "Remov ...
- qq临时会话代码修改
使用:http://wpa.qq.com/msgrd?V=1&Uin=965745468&Site=www.***.com&Menu=yes提示 抱歉,无法发起临时会话,您可以 ...
- 错误提示: An App ID with identifier "*****" is not avaliable. Please enter a different string.
百度了很多,但大多的解决办法就是 更改BundleID,的确管用,,但是有的情况下,你需要跟同事合作,公用同一个BundleID, 我是这样处理的:工具栏中打开Window—project删除所有工程 ...
- HTML标签的改变
/*这些都是前端面试中经常考到的内容,必须要掌握的*/ 一.新的文档类型声明(DTD) 1.HTML5的DTD声明为:<!doctype html>或者<!DOCTYPE html& ...
- setContentScaleFactor 设置图片的分辨率
float scale = [[UIScreenmainScreen] scale];//得到设备的分辨率 [imageView setContentScaleFactor:[[UIScreen ma ...