react-native: [Master Task] Print: Entry, ":CFBundleIdentifier", Does Not Exist
Please see #21303 to understand why you’re running into this
(Edited by @hramos - the original issue text has been replaced with a description of the problem)
Description
This issue describes a class of failures where the iOS build fails with the following output:
Print: Entry, ":CFBundleIdentifier", Does Not Exist
This error message is a red herring as the problem is not actually caused by a missing :CFBundleIdentifier
entry. What this output means is that your iOS project could not be built successfully.
If you are encountering this issue, please try the following:
- Upgrade to the latest React Native release.
- Upgrade to the latest Xcode version.
- Read through the Getting Started guide if you haven’t in a while, and make sure your development environment is up to date.
- Try building your project again.
If none of these resolve your issue, please read through this thread to learn about what has worked for others. Please refrain from adding “me too” comments unless you have material information that contributes to others’ solutions.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 157
- Comments: 134 (16 by maintainers)
Commits related to this issue
- Add some debug logging if tar fails Summary: This is to help debug the root cause of https://github.com/facebook/react-native/issues/14423 Reviewed By: javache Differential Revision: D5254713 fbsh... — committed to facebook/react-native by mhorowitz 7 years ago
- Upgrade react and re-eject /ios and /android To fix this issue: https://github.com/facebook/react-native/issues/14423 — committed to s11i-code/journey-tracker by deleted user 7 years ago
- add react-native-git-upgrade - I had this issue, https://github.com/facebook/react-native/issues/14423#issuecomment-312334645 — committed to growthcode/ReactModoro by growthcode 7 years ago
- Make ios-install-third-party.sh more robust Summary: See https://github.com/facebook/react-native/issues/14423 This adds checks after download that each file is present, and has the correct sha1 has... — committed to facebook/react-native by mhorowitz 7 years ago
After trying absolutely everything in this tread and this one https://github.com/facebook/react-native/issues/7308 I still kept getting the same issue on: react-native-cli: 2.0.1 react-native: 0.45.1
My build process would just error out and stop, giving me:
I then deleted the
ios/
andandroid
/ folders and didreact-native eject
then triedreact-native-git-upgrade
for the thousand time, and it worked!My fix was a match of some of the above mentioned solutions:
rm -rf node_modules && rm -rf ~/.rncache && yarn
Fixed by removing everything from ~/.rncache/
Repeating what I just said in #14447:
I just merged several related issues. Let’s avoid opening new issues for the same error message for now.
Workaround
If you run into this issue, it seems like the preferred workaround at this time is to do the following:
Then run the
run-ios
command again, making sure it finishes:IMPORTANT
Wait for the
run-ios
command to finish in its entirety. You should see several messages that follow this format:curl: Saved to filename 'glog-0.3.4.tar.gz'
. Do not press CTRL+C to kill the process.Thanks to @jjerryhan for arriving at the above list of steps (see Handling third party build error on React Native for an explanation behind why some people may end up in this state).
Next Steps
Help us debug the issue
In a555551aaf1de1aff2a58f7aa09e970bcd003f7f, @mhorowitz placed additional logging in the build script to help us debug the issue.
If you see the following message, Unpacking ‘SOME_FILENAME_HERE’ failed. Debug info:, when running
react-native run-ios
, please comment here with the output following the Debug info: phrase.Contribute a fix
Marc commented earlier in this thread with some ideas:
Keep the thread focused
To aid in the investigation, please refrain from adding “me too” comments unless you have new information to share.
Duplicate of #14447
I’ve met that error, I passed these steps and finally succeeded to build.
I thought I’ve figured out how to fix this problem. It turns out that the
node_modules/react-native/ios-install-third-party.sh
did not run out right (Maybe because the network).So, I did the following steps:
.sh
, put it in the~/.rncache/
.node_modules/react-native/third-party/
, rantar -zxf ***
to each file.Temporary Solution
Download boost_1_63_0.tar.gz to
~/.rncache/
, replace if exist.I downloaded the library boost_1_63_0.tar.gz, replace it in ~/.rncache/ and extract it in /node_modules/react-native/third-party/boost_1_63_0 and it worked.
+1
Tried everything, still getting “Print: Entry, “:CFBundleIdentifier”, Does Not Exist” error.
i have try many ways, but no ways
Reinstall node_modules
rm -rf node_modules && yarn
@spotelf13 thank you! this solved my issue
Dependencies:
I had this issue too, but it disappeared once I removing everything from ~/.rncache/ and used command react-native-git-upgrade
It’s not working, nothing is working I’m losing my faith in react-native now
@SteveAlexander Your info led me to the solution but I needed to make the changes from inside Xcode Prefs.
in Pref> locations I left Derived Data: Default but after clicking “advanced” i changed my build location to “Custom” > Relative to Workspace and set Products to: “build/Build/Products”
This solved it for me! I have XCode 9.2 (9C40b) react-native-cli: 2.0.1 react-native: 0.51.0 MacOS 10.12.6
@hramos I don’t think it’s appropriate to mark a bunch of other issues as duplicates of this issue. This issue basically means the project could not be compiled, and it could be a dozen of reasons (project name problem, cache problem, etc…).
But for other issues, e.g. #14404, they have very explicit reason for the error.
In my case, this is how I solved the problem:
the command of
react-native run-ios
only brought a very vague error message (as titled), however using xcode to open the.xcodeproj
project in<project>/ios
and explicitly build would give a much helpful message. In my case, it’sboost/iterator/iterator_adaptor.hpp file not found
(I suspect) the automatic download of boost_1_63_0.tar.gz has some problems. And the first build of project caused a false cached extract folder in the project. So I need to replace both. (see below)
as mentioned by @CrazyWr, I downloaded the new
boost_1_63_0.tar.gz
from https://github.com/react-native-community/boost-for-react-native/releasesAnd I also removed the folder of
<project>/node_modules/react-native/third-party/boost_1_63_0/boost
, and copy an extracted folder fromboost_1_63_0.tar.gz
to thereuse xcode to clean and rebuild the project (no need to restart xcode)
now
react-native run-ios
works tooMy belief is that somehow the files in ~/.rncache/ are corrupted, and so unpacking them doesn’t work right, but for some reason the error is not caught. https://github.com/facebook/react-native/blob/master/scripts/ios-install-third-party.sh will not re-download those files once they exist in ~/.rncache/. If you’re running v0.47.0-rc.0 or newer, the debug info at line 22-24 may help confirm.
I believe at this time the correct fix is for the ios-install-third-party.sh script to encode the sha hashes of the files which it will download, and verify the contents of ~/.rncache/ against them before using them. If the hashes don’t match, It can retry the download a few times. This should fix the problem for good.
If someone wants to work on this, that would be awesome, or else I will do it when I can. For now, the workaround is to
rm -rf ~/.rncache
as pointed out by several people above. (thanks!)hey, guys, I think we should download the boot_1_63_0 from here size: 11.7M rather than this size: 80+M, and the file path is:
your-project-name/node_modules/react-native/scripts/ios-install-third-party.sh
like this: after downloading, replace theboot_1_63_0
inyour-project-name/node_modules/react-native/third-party/boot_1_63_0
We’re tracking a particular failure in this master task. If you’re confident your issue is unrelated to this one, please go ahead and create a new task.
@SidharthRaveendran’s solution worked for me. I did a few additional steps beforehand so I’m not sure if they’re needed.
Dependencies:
Edit
It appears that running
react-native upgrade
created an entire directory inside ofios
with my React Native build so thereact-native run-ios
command was just showing the RN app, not the one integrated into the previous app. I downgraded toreact-native
0.51.0
and compiled in Xcode and am at least running for the time being. I’m building a POC so it’s not a longterm fix.TL;DR: The original commands appear to have not worked correctly so I downgraded to
react-native
0.51.0
.Solved this by:
$ rm -rf node_modules && rm -rf ~/.rncache && yarn or npm install
$ react-native upgrade
Dependencies used:
** BUILD SUCCEEDED ** 👍
Why is this closed? I tried 4 or 5 solutions and none of them work.
Nothing here have solved my issues with
react-native run-ios
and the CFBundleIdentifier issue. My only solution is to build from Xcode.I tried all solutions pointed above, and all failed.
I download boost_1_63_0.tar.gz and replaced it at
~/.rncache
as @iineva said. And thenreact-native init proj
.cd proj && react-native-git-upgrade
(npm install -g react-native-git-upgrade
firstly).react-native run-ios
succeeds.Hope it helps.
n my case, this is how I solved the problem:
the command of react-native run-ios only brought a very vague error message (as titled), however using xcode to open the .xcodeproj project in<project>/ios and explicitly build would give a much helpful message. In my case, it’s boost/iterator/iterator_adaptor.hpp file not found
(I suspect) the automatic download of boost_1_63_0.tar.gz has some problems. And the first build of project caused a false cached extract folder in the project. So I need to replace both. (see below)
as mentioned by @CrazyWr, I downloaded the new boost_1_63_0.tar.gz from https://github.com/react-native-community/boost-for-react-native/releases
And I also removed the folder of <project>/node_modules/react-native/third-party/boost_1_63_0/boost, and copy an extracted folder from boost_1_63_0.tar.gz to there
use xcode to clean and rebuild the project (no need to restart xcode)
now react-native run-ios works too
It works!! thank u
I had this issue too, but it disappeared once I used
react-native-git-upgrade
for the upgrade.@ptvandi, thanks for a good solution!
Errors:
"dependencies": { "react": "^16.3.0-alpha.1", "react-native": "0.54.1" }
Downgraded Solution:
"dependencies": { "react": "16.2.0", "react-native": "0.53.3" }
I tried all the solutions above, including the workarounds, nothing works.
I think it’s XCode 9. It used to work fine with the previous version.
Seriously we still don’t have a fix for this?
@hramos @here
Updated React Native to 0.50.0 and React to 16.0.0 and get the same but much more info like
folly-2016.09.26.00/folly/test/ThreadNameTest.cpp: Failed to create dir 'folly-2016.09.26.00’Can’t create ‘folly-2016.09.26.00/folly/test/ThreadNameTest.cpp’
Failed to create dir repeats many times
Anyone has some thoughts according to this?
The Same issue here!
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/booty.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
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/booty.app/Info.plist Print: Entry, “:CFBundleIdentifier”, Does Not Exist
+1 same here!
Update: downloaded and replaced boost_1_63_0.tar.gz in the .rncache folder. It seem to fix the problem for me.
I had the problem described in this issue. Turns out my default build location in xcode was not set to what
runIOS.js
expects.To diagnose the problem, I followed the guidance on https://pewpewthespells.com/blog/xcode_build_locations.html
You can check the overall build location setting with
defaults read com.apple.dt.Xcode IDEBuildLocationStyle
, which might beCustom
.If it is
Custom
, then also checkdefaults read com.apple.dt.Xcode IDECustomBuildLocationType
which should for me beRelativeToWorkspace
, and alsodefaults read com.apple.dt.Xcode IDECustomBuildProductsPath
which should bebuild/Build/Products
.If the latter is not
build/Build/Products
but is insteadbuild/Products
(that is, missing aBuild/
), then reset it like this:defaults write com.apple.dt.Xcode IDECustomBuildProductsPath "build/Build/Products"
.At this point, running the iOS simulator should work.
For anyone that is having the same issue. What I did was deleted the folder
ios
and then appliedreact-native eject
. And voila.react-native run-ios
works!@sonnytron yes screw xcode. But if your’re willing to try, rm-rf ios, and react-native upgrade. will reinstall all ios build files, then react-native run-ios to re build. you can even try rm-rf node_modules and npm install
For what it’s worth, I can’t get this working for a completely blank project.
Xcode 9.4 or Xcode 10 beta, neither command line tools.
NPM fully updated, latest version of react-native, node, npm and everything.
I do not think it’s anyones’ build configuration or changes to their JavaScript code.
Because I literally cannot even get an empty new initialized project to build.
cd ./ios/build mkdir Build cd Build
then, I symlink the folders: ln -s …/Products . ln -s …/Intermediates
and last react-native run-ios to work again have a nice day 😃
In case others are still having this issue, there are some fixes mentioned above that were close to what I needed, but not quite. For me, the solution was:
File
>Workspace Settings
Derived Data
toWorkspace-relative location
, i.e.–For me, the default option was pointing to an entirely different (and totally random) directory.
None of this previous solutions works for me. I tried this and well it’s running 😃
https://github.com/facebook/react-native/issues/14382#issuecomment-313163119
Looks like this is an issue with Xcode Build Location. Try switching it to Unique under Xcode -> Preferences -> Locations -> Advanced.
To anybody who reads this:
If you’re having problems, look at the full build output, not just the last few lines. For the repro in my previous comment, here’s the end of the output: https://gist.github.com/mhorowitz/ea67d8e1793e803b2ca273395ac12ed2. The important lines are 9-10, about 80 lines before the ones in the original report. This was the hint to me about the root cause. Another option is to open the project in Xcode and ⌘B to build it. The build errors there should also help find the actual cause.
This is also why having a full repro is so helpful. Someone trying to debug can see all the relevant errors and input files. Even with the errors in the gist above, without being able to see the full list of dependences and look at their project files, I could not have identified the actual bug.
I did not understand until now that the error in the original bug report just means that the app didn’t compile or link. Given that, I’m going to close this issue. The error is too generic to give direction, and doesn’t indicate whether the error is in React Native, third party libraries, or application code.
At this point any further issues must include a more specific error, and ideally include enough to reproduce. Please open new issues for those. Thanks!
@Bolza I took a look. The problem is exactly the problem identified here: https://github.com/facebook/react-native/issues/14326#issuecomment-334613408 Recursive includes in Xcode are not scalable, and cause problems like this which are hard to diagnose. Not all recursive includes will cause problems, but some will.
In this case, the actual bug is in RNGoogleSignin. There’s a header search path entry which is recursive. (It’s not the only one in the project or the tree, but it’s the one which is causing the build to fail.) If you make it non-recursive, then the build (almost) succeeds. It looks like there’s an open pull request https://github.com/devfd/react-native-google-signin/pull/304 to fix this.
(The build almost succeeds because react-native-svg is missing from packages.json. When I add it, the app compiles, links, and runs, then gets a js error. I did not diagnose further.)
I’m experiencing this also with a brand new project created with
react-native init ...
without any spaces in my path (I don’t use spaces in paths…)What I’ve tried so far:
~/.rncache
ios-install-third-party.sh
script (which seems broken!)None of these “fixes” work for me The very same project compiles and runs on both Android and Windows - basic “init” project, no extra 3rd party libs, no code changes.
Any bright ideas are welcome.
react-native-cli: 2.0.1 react-native: 0.50.0 yarn: 1.3.2 npm: 5.6.0 node: v9.3.0 (if that matters at all…) xcode: 9.2
@hramos @srijak
Also have the same errors, and nothing helped
mkdir: third-party: Permission denied
** BUILD FAILED **
Print: Entry, ":CFBundleIdentifier", Does Not Exist
OS: MacOSX High Sierra 10.13.1 Node: 8.9.1 npm: 5.5.1 Xcode: 9.1 React Native: 0.47.2 React: 16.0.0-alpha.12
cleaning the rncache folder still doesnt work i get this message irrespective of whatever is in the users rncache
** BUILD FAILED **
The following build commands failed:
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/albums.app No devices are booted. Print: Entry, “:CFBundleIdentifier”, Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/albums.app/Info.plist Print: Entry, “:CFBundleIdentifier”, Does Not Exist
Im not sure if this is related to thirdparty or not …
Have this issue been resolved?
Still encounter this issue with
react-native@0.46.4
.I had a problem related to glog-0.3.4 not finding a file named “config.h” and it was causing the CFBundleIdentifier error.
Solved it with this steps:
cd <Project-Folder>/node_modules/react-native/third-party/glog-0.3.4
./configure
My project is a standard
react-native init
with react-native v0.55.4 (breaking changes of Babel 7 has too many errors with Jest environments right now so I don’t want to update yet).I found this issue may come out if 8081 port is occupied(In my case it is occupied by McAfee). Run command sudo lsof -i :8081 to check which process has token the 8081 port. Or you can run react-native run-ios --port 8082 to specify another port, but you need to change the port in code too.
xcodebuild: error: Unable to find a destination matching the provided destination specifier: { id:978DA498-5036-4EFA-A1D2-FF1148CB3948 }
run
react-native run-ios --simulator="iPhone 7"
Thank you. now I have found it.
@apppro123 the
.rncache
file is not inside your project. you can found it in~/
@heyjoy21 I have tried your solution but also It does not resolve this issue.
rm -rf ~/.rncache/ did not resolve this issue for me at all
@jkao1 I have tried this way (@PaulAndreRada`s solution) but also it does not work.
The error I was getting was:
boost/static_assert.hpp file not found
thrown from Folly. What worked for me, after a good couple of hours, was:ios/Pods
folderPodfile.lock
cd ios
andpod install
FYI, this will happen when xcode fails to build, it’s a very misleading error message. It seems that the Info.plist file won’t be copied to the build folder if build fails before, even though it will still try to install/launch the app.
What I found was adding --verbose to
react-native run-ios
gave me better information as to what xcode was doing. Specifically look out for error messages amongst the warning messages.It sounds like the common case with the third-party files can cause this ambiguous error message, even though it could mean many different issues too.
node_modules/react-native/local-cli/cli.js start --reset-cache
worked for me (o_0) peace out
What worked for me in solving this issue was
rm -rf /ios/build && react-native run-ios
from project directory There are still some ‘Analyzer issues’ reported afterwards but the build succeeds.
@spotelf13 Thanks it solved my issue, the
react-native upgrade
part did the trickI’ve solved this issue via:
$ rm ~/.rncache/* $ rm -rf xxx/project/node_modules/react-native/third-party/* $ vi ~/.curlrc Insert
proxy = http://x.x.x.x:port
Finally “BUILD SUCCEEDED” shows, but…
Another issue comes orz:
tar: qtn_file_apply_to_path(boost_1_63_0/.boost.dAG8VY): Operation not permitted tar: qtn_file_apply_to_path(boost_1_63_0/boost/..DS_Store.LWaUjm): Operation not permitted tar: qtn_file_apply_to_path(boost_1_63_0/boost/._accumulators.r6Lc7B): Operation not permitted …
It also happens via doing download & replace those third-part files. The project looks running good, may this is just some warnings or weak errors?
Node 8.7.0 NPM 5.4.2 React Native 0.49.3 RNCLI 2.0.1 Yarn 1.2.1 macOS Sierra 10.12.1 Xcode 8.3.3
For me, I was able to run my project with Xcode but it would fail with react-native run-ios. I figured out it was a really easy fix. From Xcode make sure your system is using the latest version of command line tools. Preferences… then the Locations panel and check the latest version of Command Line Tools is selected.
From https://facebook.github.io/react-native/docs/getting-started.html
Same issue here. I’ve MacOs El Captain on VMware.
Node v. 7.8.0 npm v.4.6.1 react-native-cli 2.0.1 react-native 0.46.4 Xcode v. 8.2.1
I’ve two issues:
init
a new react-native project, the packages fetching hangs on getting react-native 0.46.4 package from repo. Other packages were downloaded successfully. So I’ve executenpm install
from Windows and then copied thenode_modules
folder on Mac.** BUILD FAILED **
I really need to publish my app on the app store before the end of the week. I’ve already try all suggested solutions but nothin works.
Could anyone help me?
Solved this issue by removing underscores from the project directory path.
this commit seems to fix the issue Fixed issue with install third party script in directory with spaces