139

When I run react-native run-ios the build succeeds but I get the error below. I've checked all over the place but nothing seems to be working. Using sudo in front of the command does not help either. I am using Xcode 7.3, react-native-cli: 0.2.0, react-native: 0.24.1, node v5.11.0.

=== BUILD TARGET mobileTests OF PROJECT mobile WITH CONFIGURATION Release ===

Check dependencies

** BUILD SUCCEEDED **

Installing build/Build/Products/Debug-iphonesimulator/mobile.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/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/mobile.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/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:45:5)
    at doResolve (/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:200:13)
    at new Promise (/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/Users/astiefel/workspace/bosspayments/mobile/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)
astiefel
  • 2,038
  • 2
  • 16
  • 22
  • And does the bundle identifier exist in the file? I assume not, so the question is "why isn't it being written to the file". – trojanfoe May 26 '16 at 13:06
  • For me it's due react-native compatibility issue with Xcode9.4. I resolved using the following steps. "rm -rf node_modules" then "react-native upgrade" then "npm install" then "react-native run-ios" – raja Jul 18 '18 at 10:03
  • Raja..are you sure it's possible to run react-native upgrade after you've removed the node_modules folder? I tried and it said upgrade wasn't recognized – VK1 Sep 06 '18 at 06:46
  • Just close your terminal, open it again and run the app it worked for me. – Chandni Oct 18 '18 at 12:42
  • What an absolute nightmare... perhaps if there are 36 different answers to this question, spanning form 2016 to 2019, something should be done to address the underlying issue? – Scott Skiles Feb 15 '19 at 22:49
  • I've had the same issue here, I this answer helped me to figure out the solution: https://stackoverflow.com/a/26333208/4178612. I don't know why the 'product name' has changed to another name. I just changed to the original name back, and my build worked back. – JmLavoier Oct 15 '20 at 00:54

45 Answers45

117

Open Project in Xcode

If Xcode > 9 run command react-native upgrade (this overwrites all your iOS configurations, use with caution!)

then

1.Go to File -> Project settings

2.Click the Advanced button

3.Select "Custom" and select "Relative to Workspace" in the pull down

4.Change "Build/Products" to "build/Build/Products" and "Build/Intermediates" to "build/Build/Intermediates"

Add package

5.click done, done

Divye Gupta
  • 3
  • 1
  • 7
Katta Nagarjuna
  • 1,539
  • 2
  • 12
  • 12
  • 1
    This worked for me on xcode 8.2, fixed my problem thanks! – KrakenDev Feb 17 '17 at 19:37
  • @SurajShingade I have Xcode 9.4 on my machine and can't find the "Project Settings" option within "Files". I only see "Workspace Settings...". Do you know where to access Project Settings? - https://imgur.com/a/SqAemnL - holding down the option key with File menu open doesn't show it either – Pat Needham Aug 27 '18 at 15:10
  • 2
    @PatNeedham "Project Settings" was renamed to "Workspace Settings" – Toby Caulk Sep 02 '18 at 01:14
  • 3
    Can you please explain a little why this solution works ? – Victor Sep 04 '18 at 17:55
  • 3
    This is still the way to fix it as of xCode 10 – jacurtis Oct 06 '18 at 23:52
  • It worked but why do I have to do this now for every single new Project I'm creating? Do you have an idea? – GeraltDieSocke Oct 24 '18 at 17:06
  • If you dont want to have to do this for every new project in xcode you can go into Xcode->Preferences->(Locations Tab)->click Advanced then make the same change there. – omarjebari May 07 '19 at 16:04
  • I saw that path was wrong in the output, but didn't know where I can fix that, thanks a lot for this comment, works even for the latest Xcode :) – Dmitriy May 25 '19 at 22:01
  • I can't find this option of "project settings" on Xcode-12. PS: found it, it comes under "workspace setting, and it shows legacy build system is deprecated" – Shubham Kakkar Dec 28 '20 at 15:10
  • thanks a lot, brother, you saved my day. +1 for you. – Anurag Shrivastava Jun 14 '23 at 07:45
70

This is may occurs if you are missing config.h file,

For update config.h file,

1) Close your Xcode.

2) Open Terminal, go to your project's root folder and do:

cd node_modules/react-native/third-party/glog-{X}.{X}.{X}/

3) Run the configure script:

./configure

4) Open Xcode and try to run your app.

{X}: version number glog

Behnam
  • 6,244
  • 1
  • 39
  • 36
Lijith Vipin
  • 1,870
  • 21
  • 29
  • 6
    I installed react-native from scratch, created my first project, but couldn't get that to work. This answer fixed my problem. I wonder why this happens, since it's a fresh and new installation – Antonio Oct 18 '18 at 09:05
  • This worked for me. Fresh install of react-native 0.55, Xcode version 10 – mat Dec 03 '18 at 02:49
  • 2
    ... what if there is no `configure` script, as in 0.58? – Scott Skiles Feb 15 '19 at 22:53
  • Get the error : `checking whether we are cross compiling... configure: error: in /Users/macbookpro2018/sites/calendar/node_modules/react-native/third-party/glog-0.3.5 configure: error: cannot run C compiled programs.` – Bomber May 03 '19 at 10:04
37

If you're using Xcode 10, it may be due to an incompatibility with the latest build system of Xcode. Try switching to the legacy build system.

Open Xcode 10, File > Project Settings > Build System > switch dropdown to Legacy Build System.

Screenshot

Ronan Boiteau
  • 9,608
  • 6
  • 34
  • 56
ChrisBorg
  • 1,418
  • 17
  • 27
  • rats! I've lost two workdays to this issue. What's crazy is my CLI build worked just fine until 3 days ago. No idea wtf happened. This didn't fix the problem either. Wanna see a grown my cry? TT – Mike S. Feb 23 '20 at 17:12
  • 2
    Perfect, but it's saying legacy mode is deprecated. Is it problem? – Kvlknctk Feb 15 '21 at 13:13
28

Update React using react-native upgrade did it for me.

Disclaimer: this overwrites all your iOS configurations, use with caution!

Ronan Boiteau
  • 9,608
  • 6
  • 34
  • 56
sbastidasr
  • 637
  • 8
  • 9
  • 30
    overwriting all iOS files will overwrite any configurations you have made to your project. lol. use at your own risk disclaimer is the least you could do. – AlxVallejo Jun 29 '17 at 16:09
  • 2
    Would be helpful if someone could explain what "all your iOS configurations" means. – Andrew Koster Feb 27 '19 at 21:41
  • 2
    @AndrewKoster it means that if you change a file in the iOS directory, it'll be overwritten. Let's say you changed at Xcode the configurations for your project, e.g: adding the descriptions to when you prompt the user for permission. All these custom changes made there would be overwritten. – Rodrigo Vieira Sep 20 '20 at 04:55
  • 3
    Does anyone know which files `react-native upgrade` might modify? Are these files part of the project? Under version control, or ignored by default? Or are they part of the OS, outside of version control? It's all very vague. – Andrew Koster Sep 20 '20 at 21:55
21

I faced the same problem with iOS 14 and Xcode 12.

Error: Command failed: ...../Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

I solved it by removing my yarn.lock file and node_modules folder. Then install everything again with yarn install. The logic behind it is that this will upgrade your react-native-cli which fixes this error.

Daniel Tello
  • 520
  • 5
  • 10
  • 3
    Removing the lock file (in my case `package-lock.json` because I'm not using yarn) helped a ton. Worked for me. – Lazerbeak12345 Oct 27 '20 at 16:00
  • 1
    Faced the issue when running `react-native run-ios --scheme XXX`. Apparently `react-native-cli` needed to be updated to fix it. Removing `yarn.lock` did the trick! – Jan Van Echelpoel Oct 31 '20 at 15:48
14

My problem was actually that my build was in Release mode instead of Debug mode. As a result, the identifier was pointing to something that was not in existence. I changed the build type and it ended up working.

astiefel
  • 2,038
  • 2
  • 16
  • 22
  • 5
    But what if you want to run your project in Release mode? – Tieme Sep 06 '16 at 09:52
  • 1
    Check out https://github.com/facebook/react-native/issues/7308#issuecomment-245197071 or https://medium.com/@alberto.schiabel/react-native-on-xcode-beta-8-0-how-to-fix-initial-build-error-f0225c649850#.yh77u8tt5 – astiefel Sep 07 '16 at 13:02
  • @astiefel I think this is what's happening to me as well. How do you change the build type by the way? – JohnnyQ Mar 05 '17 at 04:14
  • @JohnnyQ Go to `Product` -> `Scheme` -> `Edit Scheme` and then select Debug under Build Configuration – astiefel Mar 06 '17 at 21:56
11

For react-native@0.46.4 the following did the trick for me:

1) Check your paths, open your .xcodeproj (not .xcworkspace) file and:

  • go to File > Project Settings > Advanced

  • custom > Relative to workspace

  • set the products path to 'build/Build/Products'
  • set the intermediates path to 'build/Build/Intermediates'
  • press done and save your changes

2) Run rm -rf ios/build in your project's root directory

3) Close your react packager

4) Run react-native run-ios again

Tim
  • 10,459
  • 4
  • 36
  • 47
  • Also works on : "react": "16.2.0", "react-native": "0.52.0", – Jeff Bootsholz Mar 19 '18 at 13:55
  • This solved issue for me after adding dependencies via Pods to the iOS part of our RN project. Except: I made this change in the `.xcworkspace` config. – cayleyh Sep 20 '18 at 18:59
  • @cayleyh, this did not for me exactly but it did remove the `Splashscreen` error, so are you saying you followed Tims step except you did it inside of `xcworkspace`? – Daniel May 30 '19 at 20:37
10

I also came across this issue as well and I found a way to fix it

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.

Usman Awan
  • 1,208
  • 2
  • 13
  • 30
10

The Print: Entry, ":CFBundleIdentifier", Does Not Exist message just indicates your project failed to compile or link. You'll need to go back through your output in order to find a hint about the actual root cause.

If you're having problems, look at the full build output, not just the last few lines. You may want to open the project in Xcode and hit ⌘B to build it. The build errors in Xcode should help you find the root cause of the failure.

Héctor Ramos
  • 9,239
  • 6
  • 36
  • 39
9

I had this happen to me when my node_modules folder got screwy after installing a new package. I killed the folder rm -rf node_modules and then did an npm install to re-install my packages and that fixed it.

Jade
  • 619
  • 5
  • 13
6

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.

Hal Mueller
  • 7,019
  • 2
  • 24
  • 42
Charlle
  • 61
  • 1
  • 2
3

For me it was a problem with accidently setting up modules using Cocoapods & react-native link at the same time.

Don't mix those two for same modules!

Olegdater
  • 2,381
  • 22
  • 20
3

I fixed this by deleting /build/ and running react-native run-ios again

  • @EranOr do you see `Provide a valid path to the desired application bundle.` in your console? Try the following xcode settings `file => project settings, build system: legacy, derived data: project-relative, DerivedData in the input => advanced, custom, relative to workspace, build/Build/ in the first 2 inputs` –  Dec 22 '18 at 03:31
3

I'v tried all of these solutions but the one that has worked for me is:

  1. run react-native upgrade
  2. open xcode
  3. run the application in xCode
  4. works fine!
Eli
  • 586
  • 2
  • 12
  • 28
  • thanks Eli, i have solved this issue by simply running "react-native upgrade" – Javeed Ishaq Mar 27 '19 at 11:33
  • For those who work in enterprise environments, I would urge caution using this solution. Upgrading the react-native core needs to be planned because it could negatively impact the work of others. Ask first. – Mike S. Feb 23 '20 at 18:10
2

Have you checked that you declared a bundle identifier? You can do this by Clicking on your project file in xcode and then selecting the general tab and it is listed under the first text box under "Identity". Another way to check is to check in your info.plist file in the ios folder of your project. This is how it shows in my info.plist. My actual bundle identifier for my project is in xcode.

<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
Ben Dellarocco
  • 121
  • 1
  • 1
  • 7
2

You can follow below steps to resolve this error:

Step 1

Open terminal

Step 2

cd node_modules/react-native/third-party

Step 3

ls

Copy or identify glog-{version}

Step 4

cd ../../../

Step 5

cd node_modules/react-native/third-party/glog-{version}

Step 6

./configure

I hope this will work !!!

Dheeraj D
  • 4,386
  • 4
  • 20
  • 34
1

I updated Xcode to v8 and the error was resolved.

A J
  • 2,508
  • 21
  • 26
Mech Minds
  • 11
  • 1
1

the 0.44 is ok to run,but 0.45 can not,maybe is the version problem i solved this by the following command: rninit init TaxiApp --source react-native@0.44.0;

Joshua
  • 11
  • 1
1

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

Floris M
  • 1,764
  • 19
  • 18
1

My terminal pops out the same message due to deleting some simulators I don't use in Xcode.

If you run react-native run-ios with no specific parameters, react-native will run the default simulator which is iPhone 6 with iOS 10.3.1 in my case and I deleted this simulator by chance.

Here comes my error messages:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
        { id:F3A7BF54-B827-4517-A30D-8B3241C8EBF8 }

Available destinations for the "albums" scheme:
    { platform:iOS Simulator, id:CD64F26B-045A-4E27-B05A-5255924095FB, OS:10.3.1, name:iPad Pro (9.7 inch) }
    { platform:iOS Simulator, id:8FC41950-9E60-4264-B8B6-20E62FAB3BD0, OS:10.3.1, name:iPad Pro (10.5-inch) }
    { platform:iOS Simulator, id:991C8B5F-49E2-4BB7-BBB6-2F5D1776F8D2, OS:10.3.1, name:iPad Pro (12.9 inch) }
    { platform:iOS Simulator, id:B9A80D04-E43F-43E3-9CA5-21137F7C673D, OS:10.3.1, name:iPhone 7 }
    { platform:iOS Simulator, id:58F6514E-185B-4B12-9336-B8A1D4E901F8, OS:10.3.1, name:iPhone 7 Plus }

. . .

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

In order to get rid of these, open up your Xcode and check for available simulators (as same as terminal listed) and run react-native run-ios --simulator="your device name"

For my case, I run react-native run-ios --simulator="iPhone 7", the problem solved.

Frank Wang
  • 114
  • 2
  • 6
1

After a couple of months trying all the answers, I finally update my OS to Sierra, Update XCode to the latest version and with that all the errors disappear. Hope this could help some folks out there!

damianfabian
  • 1,681
  • 12
  • 16
1

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
1

Using this version is work for me with xcode 10.1

"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.4"
1

All these solution suggests have not worked for me. I have just create a rn 0.58.5 project. And compared with my project. I saw there is no JavaScriptCore.framework under the Build Phasess > Link Binary With Libraries. After drag and drop JavaScriptCore react-native run-ios build succeeded.

JavaScriptCore.framework location: ‎⁨Macintosh HD⁩ ▸ ⁨Applications⁩ ▸ ⁨Xcode⁩ ▸ ⁨Contents⁩ ▸ ⁨Developer⁩ ▸ ⁨Platforms⁩ ▸ ⁨iPhoneOS.platform⁩ ▸ ⁨Developer⁩ ▸ ⁨SDKs⁩ ▸ ⁨iPhoneOS.sdk⁩ ▸ ⁨System⁩ ▸ ⁨Library⁩ ▸ ⁨Frameworks⁩

JavaScriptCore.framework

agenc
  • 322
  • 4
  • 10
1

For me It was ios dependencies managed by cocoapods.

Had to do this:

$ cd ToProject/ios

$ pod install

$ react-native run-ios

This worked for me

https://shift.infinite.red/beginner-s-guide-to-using-cocoapods-with-react-native-46cb4d372995

PS: Was trying to figure out work done by somebody else

user710907
  • 762
  • 5
  • 12
  • running pod install said : [!] No `Podfile' found in the project directory. – Mohammad Mirzaeyan Mar 24 '19 at 10:44
  • @MohammadMirzaeyan assumption was you have done `pod init` and you have valid Podfile. Please do not downvote If you have don't have enough knowledge to counter your claims. Since It was somebody else's project as I mentioned I already had the PodFile. I have removed pod setup completely for folks like you. – user710907 Mar 27 '19 at 11:41
1

The error message similar to The domain/default pair of (../ios/Runner/Info, CFBundleIdentifier) does not exist

Means Xcode think you plist have invalid format content.

You need to past out the content of Info.plist file to find out what's wrong with that file.

One possible problem is that this <key>s and <values>s (<array>s, <string>s, or <bool>s ) are not paired correct. For example:

<key>UISupportedInterfaceOrientations</key>         //<------ here is the key
<key>NSPhotoLibraryUsageDescription</key>
<key>NSCameraUsageDescription</key>
<string>Tagueo necesita usar la camara</string>
<key>NSMicrophoneUsageDescription</key>
<string>Tagueo necesita usar el microfono</string>
<array>                                            //<------ here is the value
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>   //<------ please compare this key
<array>                                            //<------ please compare this value
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

You only need to move the key and value togather

<key>UISupportedInterfaceOrientations</key>        //<------ here is the key
<array>                                            //<------ follow with the value
   <string>UIInterfaceOrientationPortrait</string>
   <string>UIInterfaceOrientationLandscapeLeft</string>
   <string>UIInterfaceOrientationLandscapeRight</string>
</array>
JerryZhou
  • 4,566
  • 3
  • 37
  • 60
1

I know it's an old issue, but if any questions here haven't solved your problem. I solved mine after reading this answer about another question. Let me explain:

I just had the same issue, and in my case, the Info.plist wasn't possible to be found, that's why my Product Name in Build Settings was wrong. I don't know why the name has changed sometime before.

error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier /Users/joaolavoier/Library/Developer/Xcode/DerivedData/WalletApp-dkxuxrpnrdamwmchtgsxasmjabmt/Build/Products/Debug-iphonesimulator/WalletApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
. Run CLI with --verbose flag for more details.
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier /Users/joaolavoier/Library/Developer/Xcode/DerivedData/WalletApp-dkxuxrpnrdamwmchtgsxasmjabmt/Build/Products/Debug-iphonesimulator/WalletApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:616:11)
    at Object.execFileSync (child_process.js:634:15)
    at runOnSimulator (/Users/joaolavoier/Workspace/wallet-app/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:191:45)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Command.handleAction (/Users/joaolavoier/Workspace/wallet-app/node_modules/@react-native-community/cli/build/index.js:186:9)
error Command failed with exit code 1. 

As you can see, it is looking for the Info.plist in /Users/joaolavoier/Library/Developer/Xcode/DerivedData/WalletApp-dkxuxrpnrdamwmchtgsxasmjabmt/Build/Products/Debug-iphonesimulator/WalletApp.app/Info.plist

But the WalletApp.app folder didn't exist.

Step to fix this:

    1. Go to Target > WalletApp > Build Settings tab
    1. Scroll to Packaging > Product Name
    1. Changed the Product Name to WalletApp.
    1. Removed the build folder rm -rf /Users/joaolavoier/Library/Developer/Xcode/DerivedData/WalletApp-dkxuxrpnrdamwmchtgsxasmjabmt
    1. Clean Product > Clean Build Folder
    1. Build Product > Build
    1. At last in the root of your project yarn start and yarn ios.

I hope, it can help someone.

JmLavoier
  • 523
  • 5
  • 9
0

This work for me Click on the RCTWebSocket project in your navigator and remove the flags under build settings > custom compiler flags enter image description here

Jackson Harry
  • 308
  • 1
  • 2
  • 15
0

This worked for me. Follow steps https://facebook.github.io/react-native/docs/getting-started.html (Building Projects with Native Code).

Before running react-native run-ios command, download boost node module from https://sourceforge.net/projects/boost/files/boost/1.63.0/ and replace node_modules/react-native/third-party/boost_1_63_0

Now run react-native run-ios command

PDM
  • 31
  • 1
  • 5
0

For me it's due react-native compatibility issue with Xcode9.4. I resolved using the following steps. on my project /ROOT

  1. rm -rf node_modules
  2. react-native upgrade
  3. npm install
  4. react-native run-ios

SOLVES the issue, this thread helped me to understand the issue.

raja
  • 1,151
  • 7
  • 9
0

In my case, I pull project from git and it also includes the ios folder.

First i remove ios folder rm -rf ios then, react-native upgrade

0

The basic reason is deploying port is not free. Either you restart the device and get all ports free else run $ lsof -i :8081 and find the process which occupied port 8081. Kill the process which is using port 8081 by running $ kill -9 {process_which_is_running_under_8081}

0

First run your project from Xcode then try to run from command line. That was the issue for me.

Serdar D.
  • 3,055
  • 1
  • 30
  • 23
0

I am on XCode 10 with RN version 0.5.7, I tried almost all solutions and nothing worked.

After loosing a lot of time, finally the way I got it to working by doing the following

  1. Install previous version of react-native by running react-native init project --version react-native@0.56
  2. Open project/ios/project.xcodeproj and select Debug for command line builds
  3. Make sure to select the correct development certificate
  4. Run react-native run-ios once again, this time it must work.
Ibrahim Azhar Armar
  • 25,288
  • 35
  • 131
  • 207
0

Just open the project in xcode app and it will automatically do all the imports and resolve issues. Worked for me, Xcode 10+

Edit 1: Open the iOS folder of your app not your global folder.

Rishav Kumar
  • 4,979
  • 1
  • 17
  • 32
  • no it doesnt work , with RN 0.57 and Xcode 10.1 , for a brand new react native init app – codemt Jan 03 '19 at 18:31
  • It doesn't work for Xcode 11.3 / RN 61.5, either. I can successfully launch in Xcode, but CLI continues to look in the wrong place in the `DerivedData` folder. I have no idea why. The endpoint in this path does not exist `/DerivedData/.../ios/build/Debug-iphonesimulator/React/`. – Mike S. Feb 23 '20 at 18:15
0

I got this error when I ran react-native run-ios --scheme="customscheme" and the name of customscheme was misspelled.

basbase
  • 1,225
  • 7
  • 19
0

Try to look into previous error message happened before current error i.e., "CFBundleIdentifier”, Does Not Exist.

Fix previous error then this error should disappear.

I fixed previous duplicate symbols for architecture error when run react-native run-ios --simulator="iPad Pro (9.7-inch), then the problem gone.

base64k
  • 101
  • 1
  • 4
0

I also get same error while running project react-native run-ios

But when i run project from xcode, that is work for me.

Khurshid Ansari
  • 4,638
  • 2
  • 33
  • 52
0

I had a space in my product name. The file system can't find the build directory. I changed "Grace Church" to "GraceChurch". This doesn't affect the display name. Fix in Target > Build Settings > Packaging > Product Name

build settings

redreceipt
  • 83
  • 1
  • 8
0

Follow this steps

  1. Clear Derived Data
  2. Build and Run from Xcode
  3. Now try with command line
Kirit Vaghela
  • 12,572
  • 4
  • 76
  • 80
-1

When you run npm install command some time internet issue problem, Files in node_modules\react-native\third-party is not properly downloaded so please check this is properly downloaded or not if no please remove node_modules and install it again

then run react-native run-ios command

Nisarg Thakkar
  • 1,497
  • 16
  • 25
-1

Unfortunately, none of the mentioned solutions worked for me.

After trying out some of the answers from this issue, the following finally did work:

As one or more of the required iOS third-party libraries were not properly downloaded to ~/.rncache (meaning the files in there were corrupted and could not be unzipped), I removed the content of this folder, ran react-native run-ios again, and this eventually did the trick.

Flo
  • 2,309
  • 20
  • 27
-1

FIX FOR OSX EL CAPITAN

I'm still on OSX 10.11.6 with XCode 8.2.1 ... will upgrade someday but not today. I was able to get past the :CFBundleIdentifier error by downgrading react native to 52.0

yarn upgrade react-native@52.0

Got me a successful build on the simulator. Cheers!

ether_joe
  • 1,068
  • 1
  • 13
  • 32
-1

Adding one to the list of possible causes: xcodebuild could be corrupted.

In my case xcodebuild didn't do anything, so it never generated the ios/build/ directory, and the above error resulted.

I used 'which xcodebuild' on the command line, deleted it, and the error was gone

Just took me a while to realize that xcodebuild was bad - I looked at log messages and manually ran the xcodebuild command with the react native parameters - no output of any kind. No build messages, no error messages, nothing. Ran with no params - same....

Leaving this here as one more thing to check if this error message appears. Is your xcodebuild working?

n13
  • 6,843
  • 53
  • 40
-2

Delete the node modules and run 'npm install' in your project directory. Now you can able to run the project.

Vijay Dokrimare
  • 287
  • 3
  • 6