欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

【js】react-native Could not find iPhone 6 simulator 和 Entry, ":CFBundleIdentifier", Does Not Exist 两种报错解决办法

程序员文章站 2022-04-18 09:45:11
一、在运行rn app应用时,react-native run:ios 报错出现 解决办法: 1、react-native run-ios --simulator="iPhone 6",运行时指定启动版本 2 、Open file: 打开:node_modules/react-native/loca ......

一、在运行rn app应用时,react-native run:ios 报错出现  

 1 could not find iphone 6 simulator 

解决办法:

       1、react-native run-ios --simulator="iphone 6",运行时指定启动版本

     2 、open file: 打开:node_modules/react-native/local-cli/runios/findmatchingsimulator.js

然后。查看自己的版本号。在文件30行,对比是否时这个条件:

 1 if (version.indexof('ios') !== 0) { 2 3 continue 4 } 

下面是我的代码,注释掉的是version.indexof('ios') !== 0,然后替换掉。

1  // if (version.indexof('ios') !== 0) {
2     //   continue;
3     // }
4     if (version.indexof('ios') !== 0 && !version.includes('ios')) {
5       continue;
6     }

二:上面的问题解决后,又遇到下面的问题。 entry, ":cfbundleidentifier", does not exist

解决办法:

            1、rm -rf node_modules" 然后 "react-native upgrade" 再 "npm install"  最后,"react-native run-ios

    2、先进入到

    1 cd node_modules/react-native/third-party/glog-{x}.{x}.{x}/

    这里的glog-{x}.{x}.{x},x是版本号。

    然后 ./configure 编译下文件。

1 ./configure

原文:https://blog.csdn.net/qq_33182756/article/details/89764831