无法在IOS上运行简单的React本机项目致命错误'config.h'打印条目'CFBundleIndentifier'不存在

时间:2018-09-28 06:33:30

标签: ios react-native bundler

include“ config.h” //找出对pthreads的支持

     ^~~~~~~~~~

产生了1个错误。

**生成失败**

以下构建命令失败:     编译ios / build / Build / Intermediates.noindex / React.build / Debug-iphonesimulator / third-party.build / Objects-normal / x86_64 / raw_logging.o Sep2018 / node_modules / react-native / third-party / glog-0.3。 5 / src / raw_logging.cc普通x86_64 c ++ com.apple.compilers.llvm.clang.1_0.compiler     CompileC Sep2018 / ios / build / Build / Intermediates.noindex / React.build / Debug-iphonesimulator / third-party.build / Objects-normal / x86_64 / signalhandler.o / Sep2018 / node_modules / react-native / third-party / glog -0.3.5 / src / signalhandler.cc普通x86_64 c ++ com.apple.compilers.llvm.clang.1_0.compiler (2个失败)

安装内部版本/内部版本/产品/Debug-iphonesimulator/Sep2018.app 处理命令时遇到错误(domain = NSPOSIXErrorDomain,代码= 2): 无法安装请求的应用程序 在提供的路径中找不到应用程序包。 提供指向所需应用程序捆绑包的有效路径。 打印:条目“:CFBundleIdentifier”不存在

命令失败:/ usr / libexec / PlistBuddy -c Print:CFBundleIdentifier build / Build / Products / Debug-iphonesimulator / Sep2018.app / Info.plist 打印:条目“:CFBundleIdentifier”不存在

错误:命令失败:/ usr / libexec / PlistBuddy -c Print:CFBundleIdentifier build / Build / Products / Debug-iphonesimulator / Sep2018.app / Info.plist 打印:条目“:CFBundleIdentifier”不存在

at checkExecSyncError (child_process.js:611:11)
at Object.execFileSync (child_process.js:629:13)
at Promise.then (/Sep2018/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
at process._tickCallback (internal/process/next_tick.js:68:7)

2 个答案:

答案 0 :(得分:2)

我遇到了同样的问题,使用此步骤可以为我解决:

0.44升级后,在这里也遇到了同样的问题。上面的解决方案或清除缓存都不对我有用。这是我让事情再次起作用的方法: 在终端中,导航至react-native/third-party/glog内的node_modules文件夹(对我来说,这是 cd node_modules/react-native/third-party/glog-0.3.4 ) 主动进入该文件夹后,运行

sh ../../scripts/ios-configure-glog.sh

已配置Glog,并创建了所需的config.h头文件以供Xcode查找

运行iOS BUILD

答案 1 :(得分:1)

  • 删除node_modules
  • npm缓存验证
  • npm安装
  • XCode Clean
  • XCode Run

这可以帮助我解决错误。