React-native: Can not run because ":CFBundleIdentifier", Does Not Exist

Created on 28 Sep 2018  Â·  11Comments  Â·  Source: facebook/react-native

Environment

React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) 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
Locked 📦Bundler

Most helpful comment

After trying it out with multiple test projects, what I found to work thus far is:

  1. yarn add @babel/runtime
  2. Build the iOS folder of the react-native project using the Xcode app (have to run ⌘ (CMD) +B twice for some reason, the first attempt always leads to an error)
  3. Then from the terminal, running react-native run-ios in the project in addition to yarn 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!

All 11 comments

Works for me after running:

yarn add @babel/runtime@^7.0.0
react-native run-ios
react-native run-ios

I've got the same problem...

After trying it out with multiple test projects, what I found to work thus far is:

  1. yarn add @babel/runtime
  2. Build the iOS folder of the react-native project using the Xcode app (have to run ⌘ (CMD) +B twice for some reason, the first attempt always leads to an error)
  3. Then from the terminal, running react-native run-ios in the project in addition to yarn 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!

wrok for me thanks.

this doesnt fix my issue. Dev's keep closing this issue with no set in stone reason why or fix.

npm uninstall react-native

delete ios and android folder
then run :

npm install react-native

react-native upgrade

My problem was I didn't run pod install in ios/
cd ios/
pod install
solve my problem

So what @applizem recommends gives me this:

cd ios
➜  ios git:(release/3.6.2_build) ✗ pod install
zsh: command not found: pod

Upgrading my react-native is not an option, I have 0.53.3 by the way.

I am willing to try @kardoqadir recommendation, but for the life of me, could someone explain to me how to change the bundle identifier? And what I need to change it to? A bit more than just oh just go to Build Settings. I am working with XCode 10.1 and there is no selection called Build Settings anywhere in my navigation menu and I have seen that suggestion in various posts elsewhere.

Also, how does Babel runtime fix this?

In my case
cd ios/
pod install
If you have the file Podfile.lock, remove before pod install

@camilocls , why remove the Podfile.lock file?

@camilocls , why remove the Podfile.lock file?

Someone added the file in a commit, that was generating my problem, this is generated again when you run pod install

Was this page helpful?
0 / 5 - 0 ratings