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 ...
随机推荐
- Java高级之内存模型分析
博客出自:http://blog.csdn.net/liuxian13183,转载注明出处! All Rights Reserved ! 下文是博主感悟,请带着怀疑性的态度阅读! 需要了解基本变量所占 ...
- oracle中截取某个字符前面和后面的值
创建测试表及数据 create table test(name varchar2(10)); insert into test values ('2-15');insert into test val ...
- [LeetCode] Scramble String(树的问题最易用递归)
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrin ...
- qq临时会话代码修改
使用:http://wpa.qq.com/msgrd?V=1&Uin=965745468&Site=www.***.com&Menu=yes提示 抱歉,无法发起临时会话,您可以 ...
- JSON.stringify实例应用—将对象转换成JSON类型进行AJAX异步传值
在上一篇中,对JSON.stringify()方法有了初步的认识,并且做了一些简单的例子.本篇将进一步将JSON.stringify用在复杂些的实例中,例如如下需求: 在进jQuery AJAX异步传 ...
- asp.net mvc 简单搜索功能
View中代码: <input type="text" class="searchText" id="searchText"/> ...
- c#中的linq二
c#中的linq二 using System; using System.Collections.Generic; using System.Linq; using System.Text; us ...
- iOS腾讯百度面试题
- LeetCode Basic Calculator
原题链接在这里:https://leetcode.com/problems/basic-calculator/ Implement a basic calculator to evaluate a s ...
- Eight Popular Open Source Android Game Engines
https://software.intel.com/en-us/blogs/2012/05/14/eight-popular-open-source-android-game-engines