react-native: Latest react-native app doesn't work ":CFBundleIdentifier", Does Not Exist

On OS X El Capitan v10.11.4

node --version v6.0.0 npm --v 3.8.8 react-native-cli: 0.2.0 react-native: 0.24.1 watchman --v 4.4.0 xcode 7.3

$ react-native init AwesomeProject $ cd AwesomeProject $ react-native run-ios

** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution Run\ Script /development/misc/react/AwesomeProject/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.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
/development/misc/react/AwesomeProject/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:470:13)
    at Object.execFileSync (child_process.js:490:13)
    at _runIOS (runIOS.js:91:34)
    at runIOS.js:24:5
    at tryCallTwo (/development/misc/react/AwesomeProject/node_modules/promise/lib/core.js:45:5)
    at doResolve (/development/misc/react/AwesomeProject/node_modules/promise/lib/core.js:200:13)
    at new Promise (/development/misc/react/AwesomeProject/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/development/misc/react/AwesomeProject/node_modules/react-native/local-cli/cli.js:86:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 148
  • Comments: 294 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Not yet… I finally bought a new mac and solved.

I was able to solve this issue! Looks like port 8081 was in use :

lsof -n -i4TCP:8081
node    7601 CXI624   23u  IPv6 0xc6b249599e5f1169      0t0  TCP *:sunproxyadmin (LISTEN)

So I followed the instructions from React Native Troubleshooting https://facebook.github.io/react-native/docs/troubleshooting.html

kill - 9 7601

and ran the command react-native run-ios again and everything worked as expected (on node 6 as well).

Closing this issue & thanks for your help!

I solved this issue with the react-native upgrade command, which helped me reset some details in various xcode files. At least that is what I think solved the issue.

I tried all solutions, but nothing works. Great job, react native…

The suggest solution by @consideRatio fixed this problem for me.

react-native upgrade

When nothing fixes, try on Xcode

  1. Go to File -> Project settings
  2. Click the Advanced button
  3. Select “Custom” and select “Relative to Workspace” in the pull down
  4. click done, done

As @gvlamadrid said

When nothing fixes, try on Xcode

  1. Go to File -> Project settings
  2. Click the Advanced button
  3. Select “Custom” and select “Relative to Workspace” in the pull down
  4. click done, done

5 pic

Finally got this working after reading @dmitrye 's comment. These steps just have a slight twist to @gvlamadrid 's instructions

How I fixed it.

  1. rm -rf ios/build
  2. Go to File -> Project settings
  3. Click the Advanced button
  4. Select “Custom” and select “Relative to Workspace” in the pull down
  5. When I selected this option it defaulted my paths to Build/Products and Build/Intermediates. I had to manually change these to build/Build/Products and build/Build/Intermediates

Seems the run-ios command was looking for the app in ios/build/Build/Products when it was actually being placed in ios/Build/Products. Just a hunch but maybe this has something to do with the way that mac ignores case when dealing with paths on the command line? Could be leading to the run-ios command getting tripped up. Or maybe the default path is just wrong.

I’m on XCode v8.0

I also encountered a similar error.

On OS X El Capitan v10.11.4

node --version v6.0.0 npm --v 3.8.6 react-native-cli: 0.2.0 react-native: 0.24.1 watchman --v 4.4.0 xcode 7.3

$ react-native init AwesomeProject $ cd AwesomeProject $ react-native run-ios

** BUILD SUCCEEDED **

The following commands produced analyzer issues: Analyze Modules/RCTUIManager.m (1 command with analyzer issues) Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.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 /Users/shinout/workspace/AwesomeProject/node_modules/promise/lib/done.js:10 throw err; ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:470:13)
    at Object.execFileSync (child_process.js:490:13)
    at _runIOS (runIOS.js:91:34)
    at runIOS.js:24:5
    at tryCallTwo (/Users/shinout/workspace/AwesomeProject/node_modules/promise/lib/core.js:45:5)
    at doResolve (/Users/shinout/workspace/AwesomeProject/node_modules/promise/lib/core.js:200:13)
    at new Promise (/Users/shinout/workspace/AwesomeProject/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/Users/shinout/workspace/AwesomeProject/node_modules/react-native/local-cli/cli.js:86:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)

In my case, BUILD seems to succeed. However, the process terminates with the error message above.

Nothing posted here works for me unfortunately 😦

I tried deleting all my node modules, clear cache etc and sudo as well with no luck. I do have CFBundleIdentifier in the Info.plist as:

<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>

I still get the same Entry, ":CFBundleIdentifier", Does Not Exist error that this ticket mentions. I’ve tried:

  • killing processes on port 8081
  • changing the port
  • running it with sudo
  • updating react-native (I’m on the latest version)

Any other ideas?

Interestingly enough, everything works if I open the .xcworkspace in XCode and run it from there.

I saw you posted on StackOverflow as well - any luck so far? I am playing around with master at the moment and I can’t reproduce. Maybe it’s one of the problems described there, e.g. the sudo or permissions? Also do you have CFBundleIdentifier in your Info.plist ?

nothing work for me…

What ended up working for me was that I needed to open up in XCode and change the scheme from building for a Release to Debug. Don’t know if that will work for anyone else but it is definitely something to check out. After changing it once, you can then run it react-native run-ios via the command line

I just do npm install react-native-cli@latest -g, then react-native run-ios is work!

In my case my ProductName got corrupted.

I had to change my project name, scheme name for my project and Product Name so they are all the same, and after that I started seeing the errors mentioned above. When I went to Info.plist to check what it says for my CFBundleIdentifier (or just “Bundle identifier” if you are viewing Info.plist in Xcode) I saw: com.{company}.mobile.$(PRODUCT_NAME:rfc1034identifier) So It’s a path. So I decided to investigate in Xcode - I clicked on the project name in left pane and went to BuildSettings. Under Packaging my ProductName instead of being, say “MyAwesomeApp” was something like “MyAwesomeAppApp” - last part was repeated twice. Needless to say I had to change it to match my ProjectName (MyAwesomeApp), saved in Xcode and

$ react-native run-ios

worked w/out any problems. Now it makes sense why it was showing errors: “An application bundle was not found at the provided path. Provide a valid path to the desired application bundle.” The “path” was wrong! Hope it helps someone.

Running it with sudo does not solve it for me.

Still getting the error too. Killing process on port 8081 did not work. react-native-cli: 0.2.0 react-native: 0.26.2 node: 5.3.0 npm: 3.3.12

Tested with a new project setup by running $ react-native init newProj && cd newProj $ react-native run-ios

Typing the following doesn’t give the issue but a “No devices are booted”…

sudo react-native run-ios

Had another react packager running on 8081. Killing that process made it to work.

There is something wrong with react-native init

Please do not initialize the project with react-native init ProjectName

You should append react-native version argument in the end.

For example:

react-native init ProjectName --version 0.44.2

npm install react@latest react-native@latest,it works for me after upgrade xcode 7.x to 8.0.

I got the same problem on one of my projects… You could kind work around with only XCode builds. I think it appeared after changing the name of the project.

Nothing works for me, upgraded ios to macsierra, xcode to 8.0, change the project build location, closed ports, upgrade react-native installed the latest cli. Nothing seems to work for the default react native tutorial.

The following build commands failed: Analyze RCTVibration.m (1 failure) Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.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/AwesomeProject.app/Info.plist Print: Entry, “:CFBundleIdentifier”, Does Not Exist

Any ideas?

Question: ‘boost/iterator/iterator_adaptor.hpp’ file not found’ and “:CFBundleIdentifier”, Does Not Exist

Reason:

  • /Users/Vanessa/.rncache boost_1_63_0.tar.gz, double-conversion-1.1.5.tar.gz, folly-2016.09.26.00.tar.gz, glog-0.3.4.tar.gz —this file download incomplete

Solutions: step1: you need delete .rncache,specific as follows –> rm -rf node_modules && rm -rf ~/.rncache && yarn step2:–> npm install step3:–> react-native upgrade step4:–> react-native run-ios

All you need to do is 1.run react-native init project 2. cd project 3. npm install 4. react-native run-ios and you should be golden!

Its all about Luck, Some solutions working for someone but not for anyone else, Ridiculous Good Job React native

Need to fix code manually. SecRandomCopyBytes -> (void)SecRandomCopyBytes in RCTSRWebSocket.m then tryreact-native run-ios again, it worked for me.

react-native upgrade Works for me, thanks.

after trying almost all solutions posted in this issue, this one is working on mine!

react-native init ProjectName --version 0.44.2

my environments:

 - node v6.9.5
 - npm 3.10.10
 - xcode 8.3.3
 - macOS Sierra 10.12.5

唉,已经爬坑太久,收集了很多异常处理情况。累觉不爱呀 ~~~ 其实造成 “:CFBundleIdentifier”, Does Not Exist 的问题很多。请看终极解决办法 https://hacpai.com/article/1497235254333 iOS -> ‘React/RCTBundleURLProvider.h’ file not found

Why was this issue closed? Nothing of the above helps

I resolved this with this comment after trying every solution under the sun.

  1. delete ios/ or android/
  2. react-native eject <-- this was what did it for me
  3. react-native-git-upgrade
  4. react-native link
  5. react-native run-ios

In my project, this error is caused by git. Git pull did auto merging but not successfully mergied.

I fixed it by using Atom open info.plist. Search keywords >>>>>> or HEAD or >>>>>> HEAD, fix conflict, save, done.

Same issue with react-native 0.48

downloaded a project from GitHub and faced the same problem. I don’t know much but I have solved using these steps: step 1: delete node_module step 2: delete build folder step 3: npm/yarn install step 4: react-native upgrade step 5: react-native link now you can react-native run-ios/android

react-native init ProjectName --version 0.44.2 works for me!

doing npm start -- --reset-cache and then react-native run-ios worked for me.

Please re-open this, I still experience this, and this happen to both F8 app and Hacker news example app. We are really eager to use React Native for our project, but this bug kind of block us and we are afraid of such kind of problem will happen along the way.

My setup : macos sierra 10.12 xcode: Version 8.0 (8A218a) npm: 3.10.3 “react-native”: “^0.20.0”, “react-native-gifted-listview”: “0.0.12”, “react-native-scrollable-tab-view”: “^0.3.8”, “react-native-vector-icons”: “^1.2.1”, “react-native-activity-view”: “^0.2.5”

The following commands produced analyzer issues: Analyze RCTImageLoader.m (1 command with analyzer issues)

The following build commands failed: CompileC /Users/xx/Downloads/HackerNews-React-Native-master/ios/build/Build/Intermediates/RCTWebSocket.build/Debug-iphonesimulator/RCTWebSocket.build/Objects-normal/x86_64/RCTSRWebSocket.o RCTSRWebSocket.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) Installing build/Build/Products/Debug-iphonesimulator/HN Reader.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 /Users/xx/Downloads/HackerNews-React-Native-master/node_modules/promise/lib/done.js:10 throw err; ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/HN Reader.app/Info.plist Print: Entry, “:CFBundleIdentifier”, Does Not Exist

at checkExecSyncError (child_process.js:475:13)
at Object.execFileSync (child_process.js:495:13)
at _runIOS (runIOS.js:77:34)
at runIOS.js:24:5
at tryCallTwo (/Users/xx/Downloads/HackerNews-React-Native-master/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/xx/Downloads/HackerNews-React-Native-master/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/xx/Downloads/HackerNews-React-Native-master/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (runIOS.js:23:10)
at Object.run (/Users/xx/Downloads/HackerNews-React-Native-master/node_modules/react-native/local-cli/cli.js:86:13)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)

Switch from React Native to Swift xD

@dey-dey

  • Delete ~/.rncache after re-download, or manually download into ~/.rncache
  • Extract the above files into your_project/node_modules/react-native/third-party
  • Clean & Build

@dey-dey Summarily, i encounter this problem when i create a new RN project with react-native version 0.45.0. And, i never encounter this problem before react-native version 0.45.0. So, downgrading react-native version to version 0.44.3, meanwhile, downgrading react-native’s dependency - react 's version to 16.0.0-alpha.6.
Step:

  1. Delete the folder named “node-modules”;
  2. Open package.json, then replace
"react": "16.0.0-alpha.12",
"react-native": "0.45.0"

with

"react": "16.0.0-alpha.6",
"react-native": "0.44.3"
  1. run “npm install”
  2. run “react-native run-ios”. After run this script, may still show the same problem, take it easy, just follow the step 5.
  3. open project use xcode, the click Run, your project will run correctly.

I had the same issue and I investigated what happened.

Note that I had Xcode version 7.3.1.

Looking at the error it was obvious that there is not app at the path:

Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.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.

So I checked the path and noticed that in the folder: ./ios/build/Build/Products/Debug-iphonesimulator/ I had the app Awesome Project.app with a space in the name.

My suggestion is that you check the path that mentions the error and see if the build product path is different from the path the script searches for.

Instead of changing the project/xcode settings I tried to find the source of the issue in the react-native run-ios script.

I opened the script ./node_modules/react-native/local-cli/runIOS/runIOS.js and

I found this:

const appPath = `build/Build/Products/Debug-iphonesimulator/${inferredSchemeName}.app`;

This is weird as the inferredSchemeName variable name suggests that they are using the scheme name as the executable name.

Looking above I found the variable initialization:

const inferredSchemeName = path.basename(xcodeProject.name, path.extname(xcodeProject.name));

Then I said to myself I should get a coffee and I went and got one. But this is not important or related so let me get back to the story.

I investigated further and observed that the xcodeProject.name is the name of the .xcodeproj folder.

So the expected name of the app is not the executable name I have set and instead is an invalid name.

What I did to fix this? Something I’m not proud of: I changed the runIOS.js script to use the actual app path instead of the computed one.

const appPath = `build/Build/Products/Debug-iphonesimulator/Awesome Project.app`;

Yeah, I know, not good but I just wanted to run this for now.

Maybe this helps someone figuring out an actual fix.

Just doubleclick on the RCTWebSocket project in your navigator and remove the flags like those under build settings > custom compiler flags

link:https://github.com/facebook/react-native/issues/10545

Upgrading react-native => 0.35.0 worked for me.

@alanlavintman I finally got to the same error message as you. At that point the issue was that AwesomeProject.app was in the wrong place. For me, it was NativeStarterKit.App. It was located under: ios/build/Products/Debug-iphonesimulator/NativeStarterKit.app So I copied it to: ios/build/Build/Products/Debug-iphonesimulator/NativeStarterKit.app

@gavinxyang The issue above or the 5th bullet point below could be your issue. Make sure the path reported in your “Command Failed” error actually exists for “HN Reader App” it may be in the build/Products folder instead.

There were other items I did before just to get to this point:

  • I added the Product Name Identifier to the main project as mentioned above (this helped with 1 error)
  • I removed extra Custom Compiler Flags (this wasn’t it)
  • I set the project build path to be relative per @gvlamadrid (this helped with 1 error)
  • I upgraded the default OS NodeJS version which was still 0.10.x because even though I’m using NVM, the terminal window that pops up with Packager would inherit the base OS version of NodeJS and fail.
  • And the other error I had that was stumping me: ios/build/Products/debug-iphonesimulator/NativeStarterKitTests.xctest.DSYM Where is the .DSYM coming from? It keeps recompiling with that extension. Removing the .DSYM from the extension cured the big stumper for me.
  • Port 8081 was not a problem.

Now I’m getting JS errors in the App but at least everything builds. If you follow the errors listed with “Command Failed” they are the ones actually causing the break.

I hope this helps some people who are still stuck after all the previous fixes. This may also be tied to XCode 8.0 changing things around and react-native still not compliant.

Full Details: react-native-cli: 1.0.0 react-native: 0.31.0 node: 6.6.0 npm: 3.10.3 XCode: 8.0 Mac OSX: El Capitan 10.11.6

After 3-4 hours of debugging I finally have it working. Now I will go back and try again with Pepperoni that was originally throwing similar errors when I decided to switch to NativeStarterKit.

@trevorwang thank you so much it worked for me

  1. Install react-native updated npm install -g react-native-git-upgrade

  2. Update react-native react-native-git-upgrade

  3. Run it with sudo sudo react-native run-ios

I also met this problem.My question was a file did not download completely which is named boost_1_63_0.tar.gz . You can use cd .rncache in terminal. If your boost_1_63_0.tar.gz is just few B, you should download this file buy yourself and replace it. Now boost_1_63_0.tar.gz in my file is 78M. I hope it can help you.

Ok, so what I did to fix it Run this in project directory $ npm install -g react-native-git-upgrade $ react-native-git-upgrade This will update your project to latest React Native, worked for me

This worked for me, from https://medium.com/@alberto.schiabel/react-native-on-xcode-beta-8-0-how-to-fix-initial-build-error-f0225c649850

  1. Start by opening your project on XCode
  2. head over to the RTCWebSocket project (in the TARGETS section)and double click it;
  3. in the build settings tab, select both “All” and “Combined” views
  4. look for “Apple LLVM 8.0 — Custom compiler flags”
  5. in the “Other C/C++/Warning flags” subsection just double right click and click, select the list entries and delete them tapping on the “minus” icon (please see the video below)
  6. click the run button (or press ⌘+R)
  7. you’re done!

:CFBundleIdentifier error means that you version of Xcode does not support some of the features, which react-native provides (as an example, carplay). First of all, make sure you are using the latest version of Xcode, when you use the latest version of react-native. Second, install yarn. It will improve the management of your modules. If you have node and npm installed, uninstall them and install again with brew.

Alternatively, you can downgrade your react-native. The goal is to find a version of it to fit your Xcode version.

I had this problem.

The real cause is:

  1. react-native upgrade removes PRODUCT_BUNDLE_IDENTIFIER from project.pbxproj.
  2. In your Info.plist, you use $(PRODUCT_BUNDLE_IDENTIFIER) which becomes empty and will be removed from the compiled app’s Info.plist. In the compiled app’s Info.plist, there is no CFBundleIdentifier !!!

That’s why it says ":CFBundleIdentifier", Does Not Exist. It really does not exist.

2 solutions:

  1. Use com.xxx.app instead of PRODUCT_BUNDLE_IDENTIFIER for CFBundleIdentifier in Info.plist
  2. Or, add PRODUCT_BUNDLE_IDENTIFIER back into project.pbxproj. It’s something like PRODUCT_BUNDLE_IDENTIFIER = com.xxx.app;. You can add the bundle id in your app’s Build Settings > Product Bundle Identifier.

After commented the case UIUserInterfaceIdiomCarPlay directly in Xcode on OSX Yosemite, everything works fine for me.

image

Worked after upgrading dependencies "react-native": "0.34.0"

Did not fix it for me (I killed ports, changed project settings, etc etc.)

I have just faced the issue and I got it solved by removing and reinstalling react-native-cli

which react-native rm -R /usr/local/bin/react-native npm install -g react-native-cli react native init myapp cd myapp react-native run-ios

I hope it helps

I had the same issue and I tried all the fixes in this thread, but none worked for me. So, I opened my project in Xcode and it showed me a couple of errors in the /node_modules/react-native/third-party/boost_1_63_0/boost folder. There were so many empty folders and I searched on the internet and downloaded the boost again and replaced it. My project is running fine now in Xcode, however, if I tried to run it in terminal, I am now getting this:

** BUILD SUCCEEDED **

The following commands produced analyzer issues: Analyze /Users/Kash/ReactApps/prod/albums/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c Analyze /Users/Kash/ReactApps/prod/albums/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c (2 commands with analyzer issues)

@novalagung and Gringox are right.

react-native init ProjectName --version 0.44.2

works for me today: 2017.7.6

i have tried 0.45, 0.46, they got same problem.

Same error here, but tried everything suggested here, and none solved!

Xcode Version 8.3.3 (8E3004b) react-native-cli: 2.0.1 react-native: 0.45.1



The following build commands failed:

	CompileC /Users/DiMacBook/Documents/DEV/CursoReact/teste/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Bits.o /Users/DiMacBook/Documents/DEV/CursoReact/teste/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Bits.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/teste.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/teste.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist```

I’m not sure this issue should be closed. I am running Xcode 8.3.2 (8E2002) on macOS Sierra (10.12.4).

I have tried every single thing suggested above, with the exception of wiping out ios/ and android/ because I have made changes to each because of custom native integration code. I’ve changed my bundle identifier. I’ve wiped out ios/build. I’ve done a react-native upgrade but preserved most of my android files due to changes I made. I removed those two flags from the LLVM 8.1 setting.

I can run the app if I open Xcode and do a CMD+R but react-native run-ios fails with:

** BUILD SUCCEEDED **


Installing build/Build/Products/Debug-iphonesimulator/TeamCoco.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/TeamCoco.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Pulling my hair out over here…

EDIT: After more time debugging I realized that the next-to-last line is the cause of problems. react-native run-ios is trying to run PlistBuddy against build/Build/Products which doesn’t exist. It should just be using build/Products. I have no idea how to change this dir value.

If you have this problem after renaming your application, follow these steps :

Optional :

  • Delete your ios and android folders.

Do :

  • Run this command : react-native upgrade,
  • Install this package react-native-git-upgrade and run react-native-git-upgrade in your project.

Actual dependencies

"react": "16.0.0-alpha.6",
"react-native": "0.43.4",

just use Xcode run project/ios/project.xcodeproj and retest react-native run-ios

for me it helped

react-native 0.41.2

react-native upgrade;
react-native link;

rm -rf ios/build;

react-native run-ios

[now i got different problem, react-native-maps from airbnb do not work 😦 ]

@stief510 That worked for me! Thanks!

@joshschumacher upgrade worked.

None of the above fixed it for me. I had to do the following:

  • Update operating system

  • Update XCode

  • Uninstall and reinstall homebrew

  • Uninstall and reinstall nvm

  • Get the latest version of node

  • Uninstall and reinstall yarn

  • Uninstall and reinstall react-native-cli

  • One or more of those updates ended up fixing the bug.

This works to me:

rm -rf ios/build/

Just remove the build folder and build the project again. Then, it works fine.

I noticed that this does not happen when running the packager (yarn start) myself vs react-native run-ios running the packager + launching the simulator.

react-native run-ios will put your project in a broken state; the following appeared to solve it for me, and makes react-native run-ios safe again.

  1. update .watchmangconfig to be an empty object: {}, like the template here.
  2. destroy all the things: watchman watch-del-all && rm -rf node_modules && yarn install && yarn start -- --reset-cache (use npm instead of yarn if you’re like that.)
  3. react-native run-ios

downgrade react and react-native work for me 😃

Hey guys, I’ve managed to solve this frustrating thing in two steps:

  1. rm -rf ~/.rncache
  2. install again react-native cli npm install -g react-native-cli

After this, init a new project and hit react-native run-ios, it should be working. Hope this helps you!

ROFL, @dragulceo hit on the solution that worked for me. I opened a project giving this error in xcode, and noticed that it was blowing up when it couldn’t find the directory for some file, and noticed that it was looking for a directory truncated by a space way up in the path. I just re-initialized the project to a directory with no spaces in its path and all was well.

So react native build scripts as of react-native-cli: 2.0.1, react-native: 0.46.3 can’t handle spaces anywhere in the path leading up to the project.

this blog’s resolution works for me : CFBundleIdentifier", Does Not Exist

I had the error:

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

I found the issue: do NOT use space in your project path!

What worked for me:

run npm start from a terminal

Then from XCode run the project like you would run a native iOS project. Some errors pop up in the auto-generated code (weird?).

I commented the code that caused the errors and then everything worked ok.

None of the solutions above worked for me apart from opening the xcodeproj file in xcode and running the app from there. Frustrating!

This error occurred to me when I changed the CFBundleDisplayName to another value than CFBundleName. Keeping this two values in sync solved the problem for me.

Thanks, dmitrye@!

Here is how I fix it:

  1. remove custom flags, so RCTScrollView.o can be compiled one more step further. (still fail)
  2. Replace _refreshControl with refreshControl, and comment one line. https://github.com/facebook/react-native/issues/8472
  • (void)setRefreshControl:(UIRefreshControl *)refreshControl { if (refreshControl) { //[UIRefreshControl removeFromSuperview]; } refreshControl = refreshControl; [self addSubview:refreshControl]; }

However, I still insist re-open this bug, because these thing should not happen and really frustration. Also my fix is change react-native module itself. Hope react-native can fix this for xcode 8.0, which looks like a very common problem.

@stief510 solution is exactly what got it done for me. Let me tell you how to do it. Click the Product menu in xcode, in the Scheme flyout menu, look at the bottom - you’ll see Edit Click that. A modal menu appears. The Build configuration has a select box, make sure its set to Debug. Fixed it for me.

Mmmm, this issue is one of the top Google results for react-native apps not running in the simulator (“no devices are booted”). Since this seems to still be a lingering issue for people I’m dumping some info here - YMMV.

This used to happen to me when I did iOS work for a living; oftentimes the simulator is just wonky as hell. ps aux | grep Simulator will usually give me something to kill that should’ve died already. These steps usually work for me:

  1. Kill simulator/debug server.
  2. ps aux | grep Simulator or whatever your preferred shell magic is, see if anything is lingering around that didn’t shut down correctly. If there’s something, kill it.
  3. Re-run simulator/debug server/build process (react-native run-ios). If it still gives you a “no devices booted” error (and your simulator is a black screen), just reboot the simulator completely via Hardware -> Reboot, then open your app.

Unless you actually have something running on port 8081, you shouldn’t need to change it - for some reason I see that as the most answered solution to this stuff around the web. These steps work for me pretty much every time.

Also, keep in mind if you change your NSAppTransportSecurity settings in your Info.plist, it can mess with this stuff.

If you have some other applications are always occupying port 8081 no matter how many times you have killed the process, try changing the port:

http://stackoverflow.com/questions/30216417/react-native-port-8081-already-in-use-packager-is-either-not-running-or-not-r

It solves my problem. Hope it helps someone.

Running react-native upgrade and resetting all the file fixed it for me. I then used the git to put back all the changes that were needed and it was good to go 😃 Thanks to @consideRatio for the answer

  • Removing ios/ and android/ folders
  • yarn install
  • react-native eject

Solved my problem!

same. Xcode 8.2.1 node v9.3.0

last version of react-native failed to build (0.55.2, 0.55 , 0.54 ) but with react-native 0.53.0 it’s ok :

react-native init MyApp --version “0.53.0”

My solution to this is cd ios && pod install

Then it works fine

Silly enough, but in my case a simple rebooting solved the issue.

whatever the methods we have here, react-native upgrade worked for me.

I had the same problem and solved it like this.

  1. I moved project folder to root ~ (To exclude white spaces in the path)
  2. Removed folder ProjectName/ios/build
  3. react-native run-ios

I also came across this issue as well and none of the above solutions worked for me. Until I found a way to fix.

Here is what i did:

  1. Make sure there is no white spaces in the file directory.
  2. cd <project directory>
  3. run command ‘react-native upgrade’
  4. Go to native ios folder and open xcode project.
  5. Go to File > Project Settings > Advanced…
  6. select custom > Relative to workspace
  7. products path should be ‘build/Build/Products’
  8. intermediates path should be ‘build/Build/Intermediates’
  9. now try running command in your terminal ‘react-native run-ios’

I hope that this solutions will help some of us facing this issue.

Hey guys, DO NOT use space in your project path … it solved my problem.

react-native upgrade work for me.

I had this issue and I tried to run Xcode build. Found out the build failed due to https://github.com/facebook/react-native/issues/8472. Fixed it, fixed my problem

I just got it working. I had to update Xcode to 8.2.1 (the latest version supported on El Capitan), and then (IMPORTANT!) had to remove the build directory. When you try any of the solutions above, be sure to remove your iOS build directory before running again:

rm -rf ios/build/
react-native run-ios

FWIW, I didn’t have to change the Project scheme or remove any compiler flags. Here’s my setup:

  • react-native-cli: 2.0.1
  • react-native: 0.42.3
  • node v6.10.1 (via nvm)
  • npm 3.10.10
  • OS X 10.11.6 (El Capitan)
  • Xcode 8.2.1

Hey guys, I might have found a possible solution for this. Worked for me on my 2 Mac computers. I had to:

  • update node
  • update npm
  • clean my npm cache
  • delete my project’s node_modules and download it from 0.
$ npm cache clean
$ sudo n 6.
$ sudo npm install -g npm@3.10.0
$ sudo npm install -g npm@next
$ sudo n 7.

$ cd ./your_project_folder/
$ rm -rf ./node_modules

My current environment after updating everything: Node 7.8.0 NPM 4.4.4

I’ve tried everything people posted here on my 2 macs and nothing worked. Only after going through the above steps I was able to fix my projects once and for all. Hopefully it might solve your issue too!

I had the same problem, running OSX 10.10.5 and xcode 7.

Upgrading to OSX 10.12.2 and xcode 8 fixed the issue for me.

I had this problem and I think @dragulceo had the best lead. Thank you.
If you’ve received this error, then you probably do not have the correct path for your application.

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

React Native has hardcoded it as part of their run-ios command in runIOS.js build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app

Unfortunately Xcode has different build paths depending on your configuration and on whether you are using an Xcode Project or Workspace. I believe the default path for an Xcode Project is build/Products.
I submitted this pull request 11899 to give programmers more flexibility from the CLI.

@stief510 It worked for me. Thanks!

My problem was also that I had something running on port 8081 (discovered by running sudo lsof -n -i4TCP:8081)

Fixed by using an older version of react-native by running react-native init --version 0.27 instead of react-native init to create the project.

Then, I changed the appdelegate.m file and the React.xcodeproj and the RCTWebSocketExecutor.m as detailed in the first step here.

Then, in the project folder, instead of react-native ios-run, I did npm start -- --port 5000, and then ran the project in Xcode with ⌘+R

@arun0009 Awesome, thanks for posting the answer back here 👍

Running react-native upgrade fixed the issue for me.

Adding, it works for me, when nothing above fixes:

  1. Install react-native-git-upgrade and update your project. npm i -g react-native-git-upgrade && react-native-git-upgrade
  2. Open Xcode -> File -> Project settings -> Advanced.
  3. Select “Custom”, then select “Relative to Workspace” and then click done, done.
  4. Update your CLI. npm i -g react-native-cli
  5. Update your Nodejs 8 and NPM. nvm install --lts and nvm install-latest-npm
  6. Remove ios/build and node_modules (in your project root path)
  7. Proceed again with npm install and react-native run-ios, and give me a hug 😃

It finally works here.

  • Mac OS High Sierra 10.13.4
  • Xcode 9.3
  • NPM 5.8.0
  • Node 8.11.1
  • RN 0.55.2

I tried everything above but nothing worked.My xcode version was 8.3.2.So when I downgraded react-native to react-native v0.50.4 from 0.55.0, it worked.On another laptop I tried where xcode version was 9.3 and react-native v0.55.0 worked perfectly there.

I had to downgrade allllll the way to v0.52.0. The only version that works for me

Solution:

  1. remember link your package >> react-native link
  2. upgrade your react-native version 
>> react-native-git-upgrade >> react-native upgrade => replace all !!! remember ue-link again(ref to 1.)
  3. watchman watch-del-all
  4. remove node module and reinstall, remove ios/build and re-build.

@malikmani thanks ,this worked for me. but firstly,I created a folder named assets in ios folder

Upgrading node to 8+ solved this for me.

path is wrong in runIOS.js, has one Build segment too much Should be:

const getBuildPath = function(configuration = 'Debug', appName, isDevice) {
  return `build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app`;
};

I faced the same issue and found that it was build folder permissions issue. Finally it is resolved by assigning write permissions to ios/build and all the child folders.

chmod 777 ios/build

Make sure all nested folders inside ios/build have write permissions as well.

For me Setting the Build Location to unique did the trick, XCode->Preferencec->Location->Advance->Build Location->unique

I upgraded the whole react-native ecosystem with npm install react-native-git-upgrade and react-native-git-upgrade and finally it worked for me 😃

Please Check all folder name from root Directory , the folder name should’nt have any space. If it has space Xcode wont take, it will create this error in build stages.

I was using PODS. I deleted the xcworkspace file and ran ‘pod install’ again. That fixed it for me

I meet this issue after my XCode updated, so I think the problem was XCode, not react-native, and I resolved my problem.

There may have other cases I have not run into.

I resolved this issue.

The key of this issue is ...build/Build/Products/Debug-iphonesimulator/*.app. Obviously, the run-ios command needs the Compiler to export the App to build/Build/Products in Debug mode.

So, you need make sure that:

Build Location is build/Build/Products, not XCode Default, neither Build/Products. You can find this settings in XCode’s File > Project Settings > Advanced

Build Configuration is Debug, NOT Release You can find this settings in XCode’s Product > Scheme > Edit Scheme > Run.

if your configuration is Release, Compiler will export the App to ...build/Build/Products/Release-iphonesimulator/*.app, run-ios still can’t find it.

The version of React native strictly depends on the version of your Xcode, React, and React native version - I found this when upgrading Xcode from 7.3 to 8.0 and then to the latest. 7.3 works well 15.3.2 React and 0.37 native. Xcode 8.1 works well with the latest of The cli as of Monday this week. For future reference, keep your Xcode up to date and use the cli to see which version is compatible

Encountered this problem until I googled and found this https://github.com/GeekyAnts/NativeBase/issues/936 The root cause happened to be other commands that failed, resulting in the build not being successful. Hence the cfbundleidentifier error message is just a symptom rather than the root cause. I guess many here have some other problems resulting in the build failing and the last error message is what they think is the root cause. Maybe looking more at the output helps? There could be multiple ways the build fails leading to this last message.

react-native init ProjectName --version 0.44.2 worked for me

@renguochao solution worked for me. If you initialize a new project, use react-native init ProjectName --version 0.44.0 . But this problem happened when you clone other’s project, you need change react-native version to 0.44.0 in package.json file before input ‘npm install’ command in terminal.

@renguochao’s solution worked for me , Thanks react-native init ProjectName --version 0.44.2

@florismettey your solution saves me man!!! I have tried all of the provided solutions but only this works for me. Thanks so much!

Same problem. use all solution above but not work.wtf.

I had an issue with McAffee Agent running on 8081 port fixed it with un-install and reboot : https://community.mcafee.com/thread/94244?start=0&tstart=0

Solve it! For information:

  • I use RN v 0.44 (the latest)
  • I setted $(PRODUCT_BUNDLE_IDENTIFIER) for Bundle Identifier in info.plist (Xcode 8.3)
  • I set the bundle identifier in general -> Bundle Identifier (e.g. com.mybundle.identifier)
  • Then run build again with Xcode (which will fail)
  • then run commandreact-native run-ios with success !

restart computer is work for me。 The reason is maybe there is 1 project running.

@brianneisler Your soloution saved my life. Thanks 🙏

I had the same issue. This solved it:

  • Clean the build
  • Open up the simulator and delete the app

http://stackoverflow.com/questions/26396166/unable-to-run-app-in-simulator

@mankins You’ll be able to configure your Xcode app path from the CLI with this pull request 11899 in the future. Will prevent you from having to actually move your files around.

I had this problem and was able to solve it when I realized react-native run-ios was reading from the “wrong” project. In my case the clue was the first line of output when running react-native run-ios:

Found Xcode workspace BlahBlahTests.xcworkspace

This wasn’t my main BlahBlah.xcodeproj but a test workspace I had put in the same directory.

As soon as I moved the BlahBlahTests.xcworkspace out of the ios/ directory and re-ran react-native run-ios it found the correct project and began compiling again.

Fixed in my pull request. Upvote it please.

thanks @stief510 that worked after trying everything else