facebook / react-native

A framework for building native applications using React

Home Page:https://reactnative.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

arun0009 opened this issue · comments

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)
commented

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 ?

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>

@grabbou Are you trying it with Node 6? I haven't been able to reproduce it, but I've only tried so far with Node 4 & 5, haven't installed 6 yet. Perhaps it's an issue there?

@dsibiski I had node 5.9 before and I had the same issue, I uninstalled node/npm and deleted every node module and reinstalled (that's when I got node 6 on my machine) but I still am stuck with the above exception.

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.

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.

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!

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

@shinout Hello, I have the same problem, you solve?

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

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.

This isn't working for me. I'm still getting the same error. Node 5.11

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.

Running it with sudo does not solve it for me.

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

react-native upgrade

Worked after upgrading XCode to 7.3.1

Nothing posted here works for me unfortunately :(

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.

commented

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.

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.

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

@joshschumacher upgrade worked.

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

@stief510 That worked for me! Thanks!

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

nothing work for me...

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

Nothing worked for me too. Using node v6.2.2

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

@trevorwang thank you so much it worked for me

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

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.

commented

@joshschumacher works for me too

Can confirm that react-native upgrade worked for me & that stopping processes running on port 8081 didn't as the process running on 8081 is being started by react-native run-ios

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

@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.

thanks @stief510 that worked after trying everything else

commented

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

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

react-native upgrade Works for me, thanks.

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?

commented

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)

@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.

commented

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. #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.

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

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

Fixed in my pull request. Upvote it please.

Downgrading Xcode 8 -> Xcode 7.3.1 fixed the issue for me

@CEOGavin link worked for me BUT I gotta run from XCode. react-native run-ios still gives me the error.

Running react native v0.31. Can't upgrade yet.

@ghost I have the same problem, have you solve?

@stief510 It worked for me. Thanks!

@CEOGavin thanks for sharing my article!

Upgrading react-native => 0.35.0 worked for me.

Upgrading react-native => 0.35.0 worked for me.

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

link:#10545

i got this problem tool. Node 6.8 and React Native 0.36.
react-natvie upgrade worked for me.

The error raises when I use rnpm link to link packages including native codes,
But there is no error when I use react native link

@simlegate rnpm has been deprecated and merged in to react-native. Guessing the link functionality that currently exists in the old rnpm binary is not compatible with the xcode 8.0 build structure

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.

commented

I worked run "react-native upgrade" thanks

I managed to get it working by changing the folder permissions on my project to 777.

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

I might add that on a OSX, check your hosts file contains:
127.0.0.1 localhost

I have no idea why, but that completely stopped the emulator working with the above error because my hosts file had that line commented out.

commented

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.

commented

I saw the same error about CFBundleIdentifier, and tried the above solutions which didn't work for me.

scroll up the console log little bit up, there was another error complaining about RCTSRWebSocket
which leads me to this working solution about removing a custom compiler flag in Libraries/RCTWebSocket:
#8584

I just updated react native and this started happening.

edit: I found the solution here #11265 @3dd13 check here if you have not already.

I never had this problem until this morning when I began a new project and tried a few of the solutions here with no success.

Then I noticed that after going through the fbsdk install steps in xcode I had a duplicate method declaration for:
application didFinishLaunchingWithOptions in my AppDelegate.m

I changed the latter one to application willFinishLaunchingWithOptions and the build succeeded. Future consequences? Guess I'll find out, *shrug

https://developer.apple.com/reference/uikit/uiapplicationdelegate

react-native-cli 1.3.0
react-native 0.39.1
npm 3.10.9
node 7.2.1
macOS Sierra 10.12.1

XCode: 7.2.1
react-native-cli: tried both 2.0.0 and 1.3.0
react-native: 0.39.2
OSX Yosemite: 10.10.5

Again, just followed the steps of init and run-ios

First Error

Get two different errors depending on where I'm running it from. The first is the :CFBundleIdentifier issue.

While @dmitrye and @brianneisler solutions are awesome and thorough, they didn't work for me. @dmitrye the {project}.app didn't exist in that directory.

Second Error

If I try to run in XCode I get:

screen shot 2016-12-16 at 3 29 19 pm

Update

Upgrading to sierra and commenting out the line like @veacks snippet worked: #7308 (comment)

commented

react-native upgrade works for me.

react-native : 0.34.1
node: v4.4.1
npm: 4.0.5

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

image

I was on El Capitan with RN 39.2

This :CFBundleIdentifier exception disappeared once I upgraded from Xcode 7.1 to Xcode 8.2

For anyone that's using Xcode 7.x, e.g. because they haven't yet upgraded to Sierra, just try upgrading Xcode!

@caster8013 This Solution worked for me. X-code 8.2.1.

A possible cause is a malformed info.plist this can cause that not readable CFBundleIdentifier i think this is the reason for that some peoples says that after react-native upgrade works because replace plist with a new version of info.plist.

I discover this after remove a code that i was added to info.plist that i added recently.

I hope it helps someone :)

commented

My issue was that even though I had newer versions of node installed, react-native was running using my default version of node, which was set to node version 0.10.0

I followed the error message in the new terminal that pops up, and set my default node version to 5.0 (which I had already installed with NVM, it just wasn't set as my default).

nvm install node && nvm alias default node
npm install -g react-native-cli
npm install
react-native run-ios

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.

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.

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.

@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.

npm start -- --reset-cache worked for me !

All the above didn't solve it. However, after launching in Xcode I followed the steps in #11265 (comment) and was able to get the simulator to work.

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.

The real problem isn't that we use to find these errors. Real problem is that this sh!t happens randomly. I've been developing the same project for 5 months, and now suddenly with absolutely no change it breaks miserably.

I understand this is a non-super-stable version: 0.X.Y
But then, stop promoting. Please. I wouldn't sell an unfinished car never.

P.S.: A bit overreacted, yes. Also, a bit tired.

@sospedra can you post your error message.

Yup @charlle here is the detailed info: #12080

Also I want to expose that I bump the xCode version and now works. Tho is very weird becuase it was working the old xCode for about 2 months without any trouble. And no RN deps changes: using 0.35 since day one.

commented

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

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

commented

On OS X El Capitan v10.11.6

node --version v7.2.1
npm --v 3.10.9
react-native-cli: 0.2.0
react-native: 0.36.0
watchman --v 4.7.0
xcode: 8.0 (8A218a)

$ react-native run-ios

** BUILD FAILED **

The following build commands failed:

CompileC /Volumes/Data/Win_project/mp-mobile-starter/ios/build/Build/Intermediates/RNFS.build/Debug-iphonesimulator/RNFS.build/Objects-normal/x86_64/RNFSManager.o RNFSManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

(1 failure)

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


But it works during creating the initial project and building it as below.(In this time react native version 0.40.0).
$ react-native init AwesomeProject
$ cd AwesomeProject
$ react-native run-ios

By the way, the react native project built at version "0.36.0", why doesn't it work for me?

@HY523 you don't have your 'app' in the right folder.
Installing ios/build/Build/Products/Debug-iphonesimulator/ReactNativeStarterKit.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
Which folder/directory is ReactNativeStarterKit.app located?

Changing Xcode@7. to Xcode@7.3.1 works for me! Thanks!

commented

Why was this issue closed? Nothing of the above helps

: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.

Hey so at first I couldn't get react-native upgrade to work but then I saw that there was an invalid version number listed for react-native so I changed it to what my actual version number was and then the build succeeded

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 :( ]

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!

CFBundle not found :
The solutions mentioned above did not work for me
and I didn't want to upgrade to another version because of dependencies.

In case you have dependencies on earlier versions, check to downgrade yours
first at package.json .
After that, try to delete the node_modules folder and re-install them with yarn install or npm install
next go to your ios folder and go pod install.
run react-native run-ios. If the error pops again check further up. Perhaps you will be able to see the output "** BUILD SUCCEEDED **".If thats the case then the only problem is that there has been a failure with initializing the application for the ios simulator.
Go in the simulator and run the application.
Thats what I had to do,
Hope it helps! :)

Xcode beta 8 stopped working a few days ago for me on a new, clean project (i.e. just after react-native init projectname). Upgrading to 8.2.1 got everything working again.

Upgrading react-native => 0.35.0 worked for me.

resolved by updated Xcode ☺☺☺☺