Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Fresh React本机项目失败:条目“:CbundleIdentifier“标识器”;,不存在_Ios_React Native_Cfbundleidentifier - Fatal编程技术网

Ios Fresh React本机项目失败:条目“:CbundleIdentifier“标识器”;,不存在

Ios Fresh React本机项目失败:条目“:CbundleIdentifier“标识器”;,不存在,ios,react-native,cfbundleidentifier,Ios,React Native,Cfbundleidentifier,我正试图通过以下指南建立一个全新的React原生项目: 我可以从Xcode构建并运行它,只得到一些“语义警告” 但是,当我运行本机运行ios时,会出现以下错误: Leos-MacBook-Pro:citymysteryrn leo$ yarn react-native run-ios yarn run v1.19.1 $ /Users/leo/Projekt/ReactNative/CityMysteryRN/node_modules/.bin/react-native run-ios info

我正试图通过以下指南建立一个全新的React原生项目:

我可以从Xcode构建并运行它,只得到一些“语义警告”

但是,当我运行本机运行ios时,会出现以下错误:

Leos-MacBook-Pro:citymysteryrn leo$ yarn react-native run-ios
yarn run v1.19.1
$ /Users/leo/Projekt/ReactNative/CityMysteryRN/node_modules/.bin/react-native run-ios
info Found Xcode workspace "CityMysteryRN.xcworkspace"
info Building (using "xcodebuild -workspace CityMysteryRN.xcworkspace -configuration Debug -scheme CityMysteryRN -destination id=85422E57-5311-43D4-9292-E02982FB7B67 -derivedDataPath build/CityMysteryRN")
..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
info Installing "DerivedData/Build/Products/Debug-iphonesimulator/CityMysteryRN.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/CityMysteryRN.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
. Run CLI with --verbose flag for more details.
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/CityMysteryRN.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:621:11)
    at Object.execFileSync (child_process.js:639:15)
    at runOnSimulator (/Users/leo/Projekt/ReactNative/CityMysteryRN/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:189:45)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Command.handleAction (/Users/leo/Projekt/ReactNative/CityMysteryRN/node_modules/@react-native-community/cli/build/cliEntry.js:160:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我知道有很多问题(和答案)与此相关,但这似乎是一个非常广泛的问题,我无法解决。大多数东西我都试过了,运气都不好

我还尝试将此项目与我知道正在运行的旧React本地项目进行比较,并确定了以下差异,但不知道它们是否重要:

  • node\u modules/react native/
  • 生成文件夹包含文件夹
    ios/Build/MyProjectName
    包含
    日志
    info.plist
    等,而较旧的项目直接在
    ios/Build/
    中包含这些文件和文件夹
这是
本地信息的输出

System:
    OS: macOS 10.15.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 296.96 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.13.1 - /var/folders/5k/d42fx4ms6pv83hp9q0f9xvh40000gn/T/yarn--1574448680125-0.03761777189202431/node
    Yarn: 1.19.1 - /var/folders/5k/d42fx4ms6pv83hp9q0f9xvh40000gn/T/yarn--1574448680125-0.03761777189202431/yarn
    npm: 6.12.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
  IDEs:
    Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
  npmPackages:
    @react-native-community/cli: ^2.9.0 => 2.10.0 
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.5 => 0.60.5 
  npmGlobalPackages:
    react-native-git-upgrade: 0.2.7
    react-native: 0.53.3
/ios/MyProjectName/Info.plist
中的CFBundleIdentifier如下所示:

<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
CbundleIdentifier
$(产品\捆绑包\标识符)

这不是一个合适的解决方案,但是


我受够了,备份了我的MacBook,把整个东西都擦干净了。现在可以使用了。

您的Info.plist文件中是否有
CFBundleIdentifier
?您能尝试删除您的ìos/build`文件夹并再次运行命令吗?是的,它就在那里。在上面的问题中添加了值。删除
build
文件夹并再次运行
本地运行ios
会导致创建build文件夹,然后出现相同的错误。但是,从Xcode构建和运行仍然可以正常工作。而且bundle id值不是空的吗?我将寻找另一个解决方案不,Xcode项目中的bundle identifier字段有一个值。