Can not run because ":CFBundleIdentifier", Does Not Exist
See original GitHub issueEnvironment
React Native Environment Info: System: OS: macOS 10.14 CPU: x64 Intel® Core™ i5-4570 CPU @ 3.20GHz Memory: 101.54 MB / 8.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 10.11.0 - /usr/local/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0 IDEs: Android Studio: 3.2 AI-181.5540.7.32.5014246 Xcode: 10.0/10A255 - /usr/bin/xcodebuild npmPackages: react: 16.5.0 => 16.5.0 react-native: 0.57.1 => 0.57.1 npmGlobalPackages: react-native-cli: 2.0.1
Description
After installing new OSX Mojave, when I try to run new projects the process will fail and asks that “:CFBundleIdentifier”, Does Not Exist.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/kardoqadir/apps/myApp/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/json.o /Users/kardoqadir/apps/myApp/node_modules/react-native/third-party/folly-2016.10.31.00/folly/json.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/myApp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/myApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/myApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:611:11)
at Object.execFileSync (child_process.js:629:13)
at Promise.then (/Users/kardoqadir/apps/myApp/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
Reproducible Demo
Here is the source codes https://github.com/kardoqadir/react-native-demo
Fixing
It fixed by: 1- Changing the bundle identifier. 2- Adding package:
yarn add @babel/runtime
3-
watchman watch-del-all
4- Removing the build:
rm -rf ios/build
5-
sed -i '' '/DevelopmentTeam = V9WTTPBFK9/d;/DEVELOPMENT_TEAM/d;/ProvisioningStyle = Automatic/d' ./node_modules/react-native/React/React.xcodeproj/project.pbxproj
6-
react-native start --reset-cache
7-
react-native run-ios
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:11
npm uninstall react-native
delete ios and android folder then run :
npm install react-native
react-native upgrade
After trying it out with multiple test projects, what I found to work thus far is:
yarn add @babel/runtime
react-native run-ios
in the project in addition toyarn start
for the bundler (if the bundler doesn’t automatically launch in the terminal) will make the project start working again without having to do it through the Xcode app.Oddly enough, I wasn’t experiencing this error even with Xcode 10 until I upgraded to OSX Mojave a couple days ago.
Hope that helps!