9

I have create sample React Native project and following the tutorial as per react native website.

I have try to run the application IOS simulator, its throwing error as below ,

 ** BUILD FAILED **


        The following build commands failed:
            PhaseScriptExecution Install\ Third\ Party /Users/Test/Documents/REACTJS/SampleReactNative/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
        (1 failure)

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

my environment setup information,

  • node version v9.8.0 npm version 5.6.0 react-native-cli: 2.0.1 react-native: 0.54.2 xcode 9.2

Please help us to resolve the issues.

Developer KE
  • 71
  • 1
  • 2
  • 14

11 Answers11

4

I have the same problem right after init:

react-native init myapp cd myapp react-native run-ios

..although run-android was fine.

Not a solution but a workaround for the moment, maybe be to init using a lower version of RN:

react-native init myapp --version react-native@0.51.0

That builds okay. Similar in an existing project, install an older version of RN.

Other versions before 0.54.2 might work but I haven't tried.

(edited 2018/4/2) Found my solution from this link: https://github.com/facebook/react-native/issues/18238

RN 0.54 requires types available since iOS 11. So you have to upgrade your xcode and set minimum iOS version in your app to 11

In short, upgraded OSX & Xcode to the latest. (As of today, OSX 10.13.4 Xcode & 9.3)

kc2
  • 207
  • 3
  • 12
3

This may happen because of some library files not found.You need to follow some steps That I have done and it is worked perfectly for me. 1.) go to Xcode project -> Target -> select build Phase -> Go to target dependies -> Click on + -> add "react" and press add.

2.) Xcode > Product -> scheme > manage sceme -> click on + button -> targetName(React) -> Okay -> make shared of this by select checkbox under shared column.

3.) Clean your project and try to build, If it is getting some error like "glog/logging.h file not found" or "cofig.h file not found" in Xcode and "CFBundleIdentifier not exist" then do not worry. You are just one step far. This is may occurs if you are missing config.h file, For this you need to update config.h file. For this

4.) follow below steps a.) close your Xcode b.) Open terminal with the project (Or you can directly left click your project and drag your folder to closed terminal, [It will automatically take the path from your that corresponding folder]) c.) write command

cd node_modules/react-native/third-party/glog-0.3.4/

d.) Run the configure scripted file by the command

./configure

e.) now close terminal and go to terminal with your project root path. now try final run your iOS project by

react-native run-ios

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Himani Sharma
  • 1,550
  • 2
  • 10
  • 12
2

Run the command:

react-native upgrade
react-native run-ios

or:

react-native run-android
Nimantha
  • 6,405
  • 6
  • 28
  • 69
  • You better watch out when you perform react-native upgrade, it basically wipe out your project and replaces with new react-native project. – morph85 Jun 11 '19 at 09:05
2

For XCODE 10.0, I did two things

1) check out this answer which basically says Go to File -> Project settings

Click the Advanced button

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

Change "Build/Products" to "build/Build/Products"

2) If (1) doesn't work for you then open your project from xcode go to project navigator and select your project name --> go to info --> use debug for command-lines builds.

do this

3) go to terminal and react-native run-ios

SUMIT NIHALANI
  • 387
  • 1
  • 10
1

Try to add CFBundleIdentifier in the Info.plist as:

 <key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
Priyanga Manivelan
  • 432
  • 1
  • 5
  • 14
1

I experienced this issue due to the xcode 12 upgrade, and I solved my problem by upgrading my rn by using this command:

react-native upgrade

then go to podfile change your:

pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"

to:

pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker"
Nimantha
  • 6,405
  • 6
  • 28
  • 69
0

Do you have CFBundleIdentifier in your Info.plist?

If not than add it for eg. com.ios.learning

enter image description here

Pankaj Bhardwaj
  • 2,081
  • 1
  • 17
  • 37
0

Usually, this error comes up due to inconsistent versions (either of react-native, OS or XCode). I had the same issue with react-native v0.57.0 on MacOS Sierra and XCode v9.x. All I had to do was to upgrade to High Sierra and then XCode to v10.0.

Otherwise, you'd have to use an older version of react-native either by downgrading it or by initialising a project with an older version

react-native init test --version react-native@0.x.x
Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156
0

In my case, just delete the build directory, Pods directory, node_modules directory and running yarn install, pod install and npx react-native run-ios solves the issue.

Kasra
  • 1,959
  • 1
  • 19
  • 29
0

React Native is trying to install your app on a different app name for some reason. What you can do is in Xcode --> build settings --> packaging --> change the product name to the one given in the path which the simulator is trying to install.

Look at this: https://amala-gopal.medium.com/entry-cfbundleidentifier-does-not-exist-6098b90516f6

KetZoomer
  • 2,701
  • 3
  • 15
  • 43
-1

npm uninstall react-native

delete ios and android folder then run :

npm install react-native

react-native upgrade

Ala'a
  • 75
  • 1
  • 4