Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
arun0009 opened this issue Apr 30, 2016 · 294 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@arun0009
Copy link

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)
@grabbou
Copy link
Contributor

grabbou commented Apr 30, 2016

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 ?

@arun0009
Copy link
Author

arun0009 commented May 1, 2016

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>

@dsibiski
Copy link
Contributor

dsibiski commented May 1, 2016

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

@arun0009
Copy link
Author

arun0009 commented May 1, 2016

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

@shinout
Copy link

shinout commented May 1, 2016

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.

@ms88privat
Copy link

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.

@arun0009
Copy link
Author

arun0009 commented May 2, 2016

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 arun0009 closed this as completed May 2, 2016
@dsibiski
Copy link
Contributor

dsibiski commented May 2, 2016

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

@ghost
Copy link

ghost commented May 13, 2016

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

@shinout
Copy link

shinout commented May 13, 2016

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

@consideRatio
Copy link

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.

@stief510
Copy link

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

@andreacab
Copy link

andreacab commented May 26, 2016

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.

@stief510
Copy link

Running it with sudo does not solve it for me.

@joshschumacher
Copy link

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

react-native upgrade

@rjain15
Copy link

rjain15 commented May 28, 2016

Worked after upgrading XCode to 7.3.1

@bradennapier
Copy link

Nothing posted here works for me unfortunately :(

@rosiakr
Copy link

rosiakr commented Jun 13, 2016

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.

@yellowbang
Copy link

yellowbang commented Jun 16, 2016

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.

@idris
Copy link

idris commented Jun 16, 2016

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.

@stief510
Copy link

stief510 commented Jun 16, 2016

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

@y0unghe
Copy link

y0unghe commented Jun 18, 2016

@joshschumacher upgrade worked.

@gvlamadrid
Copy link

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

@sydneyitguy
Copy link

@stief510 That worked for me! Thanks!

@mateoguzmana
Copy link

This works to me:

rm -rf ios/build/

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

@alexyashin
Copy link

Downgrading from react-native v0.55 to v0.54 worked for me

@rpmonteiro
Copy link

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

@mateoguzmana
Copy link

mateoguzmana commented Apr 6, 2018

react-native v0.55.0 has a problem with this actually. Wait until the fix. #18681

@priteshpoddar
Copy link

priteshpoddar commented Apr 9, 2018

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.

@AbdelMounhim
Copy link

AbdelMounhim commented Apr 9, 2018

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"

@felimoles
Copy link

react native need specific the RN version: xcode version require, node version or something
for example: rn 0.54 need xcode >9.1 , node >6.5 and android sdk >24 (maybe others dependencies)

@AbdelMounhim
Copy link

i have migrated my macbook from captain to sierra.
On sierra, the last version xcode (9.3) can be installed.
and now react-native works.

@lindoelio
Copy link

lindoelio commented Apr 11, 2018

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

@raulghm
Copy link

raulghm commented Apr 16, 2018

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

Solved my problem!

@TwinkleTrivedi
Copy link

still issue with CfBundleIdentifier

Print: Entry, ":CFBundleIdentifier", Does Not Exist

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app3@0.1.0 ios: react-native run-ios
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app3@0.1.0 ios script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@redbluenat
Copy link

I had this problem in my VSC console and I did:
Go to File -> Project settings
Click the Advanced button
Select "Custom" and select "Relative to Workspace" in the pull down
click done, done
But error still was the same.
So I opened Xcode and tried to compile, I received an error with react-native-maps. I clicked auto fix and it resolves issue.

I hope it helps somebody :)

@brascene
Copy link

Switch from React Native to Swift xD

@matheusmonte
Copy link

just follow this link 👍

https://stackoverflow.com/questions/37461703/print-entry-cfbundleidentifier-does-not-exist

delete your ios/build folder and open Xcode and change build path after this, build again.

I hope help someone and avoid spend 2 hour trying to solve this

@himanshusingh2407
Copy link

Running react-native upgrade fixed the issue for me.

@kaym0
Copy link

kaym0 commented Apr 22, 2018

What worked for me was going into my React-Native project directory (main directory) and deleting the ios directory. Then in terminal type react-native eject, which will then generate another ios folder. After that, it instantly worked for me. It's important to note that if you have anything important in the ios directory to save it, but anything that's automatically generated by ejecting will be recreated and in a way that actually works. I guess this method doesn't work for people using Expo, as ejecting means you can no longer use it. I did not have to delete android folder, but you can do that too as ejecting will generate bother ios and android folders (if and only if they are missing)

@ishigamii
Copy link

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

@midoalone
Copy link

Updating react using react-native upgrade worked for me

@abdullahceylan
Copy link

It because of the react version. If you upgrade react too, then it will work without problem.

@kranzky
Copy link

kranzky commented May 5, 2018

I fixed this by editing node_modules/react-native/local-cli/runIOS/runIOS.js to change the value returned by getBuildPath to Build/Products/${configuration}-${device}/${appName}.app (removing the initial build/

this reverts the fix in #18700

here's my setup:

Environment:
  OS: macOS High Sierra 10.13.4
  Node: 8.11.1
  Yarn: 1.6.0
  npm: 5.6.0
  Watchman: 4.7.0
  Xcode: Xcode 9.3 Build version 9E145
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: 16.3.2 => 16.3.2
  react-native: 0.55.3 => 0.55.3

@kranzky
Copy link

kranzky commented May 5, 2018

Just to follow this one up, after discussing with the author of the fix in #18700, you need to make sure that the build location in Xcode preferences is set to "unique" (I had it set to something else, which broke things for me):

39661487-0680544e-5074-11e8-8c39-a30907e259eb

You then must set the build location in project settings to "Xcode default":

screen shot 2018-05-05 at 15 09 21

That fixed it for me, with the environment shown in the previous comment (React-Native 0.55.3, Xcode 9.3). No other jiggery-pokery was required; no deleting directories or running upgrade commands or anything else. Hope this helps somebody else.

@bozzmob
Copy link
Contributor

bozzmob commented May 6, 2018

Created a NEW project.

  • Did rm -rf node_modules and rm -rf ios/build.
  • Done with changing paths like @kranzky said.
  • Done doing all crazy Project Settings n stuff on Xcode
  • Done with all the react-native upgrade and some react native git upgrade kinda thing as well, which react-native officially tells you to use.
  • Done with everything SO & GH issues asked me to do.
  • Now, not sure what else to do!

Still fails with the same error.

Tried everything! I never want to give up, but, this is so funny! Everyone comments IT WORKS. And nothing works for me :D #GLHF

react: 16.3.1
react-native-cli: 2.0.1
react-native: 0.55.3

@brenmcnamara
Copy link

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.

@daronwolff
Copy link

I have the same problem. The app does not work after execute npm run eject

react-native info
Scanning folders for symlinks in /Users/ksquarelabs/dev/courses/ghost/node_modules (14ms)

Environment:
  OS: macOS High Sierra 10.13.4
  Node: 6.9.1
  Yarn: 0.22.0
  npm: 3.10.8
  Watchman: Not Found
  Xcode: Xcode 9.3.1 Build version 9E501
  Android Studio: 2.3 AI-162.3764568

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: ~0.55.2 => 0.55.4

@auxilioivy
Copy link

So, I have the same problem and It works by issuing the command below:

cd ./ios/build
mkdir Build
cd Build

then, I symlink the folders:
ln -s ../Products .
ln -s ../Intermediates

and last react-native run-ios to work again
have a nice day :)

@AlirezaAkbarix
Copy link

I had the same issue, in my case the length of fabric node_module dir was too long, so I pulled the repo in the root (~) dir and run it again and everything was OK :) I hope it helps you.

@aiavci
Copy link

aiavci commented May 24, 2018

Does anyone know the cause? I get this when I try to run the app in a custom directory e.g. react-native run-ios --project-path="../"

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests