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

Get rid of "CFBundleIdentifier" error #107

Closed
grabbou opened this issue Jan 21, 2019 · 2 comments · Fixed by #139
Closed

Get rid of "CFBundleIdentifier" error #107

grabbou opened this issue Jan 21, 2019 · 2 comments · Fixed by #139
Labels
bug Something isn't working command: run-ios
Milestone

Comments

@grabbou
Copy link
Member

grabbou commented Jan 21, 2019

This is super old issue that happens when you run "run-ios" (usually for the first time on a newly inited project). It's one of the pinned issues in React Native and one of the most popular errors people are struggling with.

If this is a "wont fix", we should consider changing the logic of the command itself to avoid this mistake.

I am opening this issue as a memo for the future.

Related: facebook/react-native#21303

Stack trace:

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

    at checkExecSyncError (child_process.js:611:11)
    at Object.execFileSync (child_process.js:629:13)
    at Promise.then (/Users/grabbou/Repositories/react-native/node_modules/@react-native-community/cli/build/runIOS/runIOS.js:183:36)
@Kielan
Copy link

Kielan commented Jan 24, 2019

I agree! I have my own internal documentation on all of the possibilities that can cause the :CFBundleIdentifier error but it needs to be clear for everyone.

Esemesek pushed a commit that referenced this issue Feb 1, 2019
…fier (#139)

Fixes #107 

Summary:
---------

Bugs fixed:
- "CFBundleIdentifier" printed every time "run-ios" fails, shadowing the real cause for the problem
- "run-ios" running a previous/cached version of an app (usually when there was an error during build step that was ignored)

Changes made:
- Decided to turn Flow and ESLint and apply all the changes as I am working on it. I know the diff might be strange at first sight, but if you look closely, it's just cosmetics to satisfy various rules
- I also extracted some blocks to separate utilities for better readability
- I also removed a no longer needed check for CRNA which is deprecated (and IMO, is not needed)
- Converted few functions to "async" form for better readability
- Started capturing the "stderr" of "xcodebuild" and started relying on its error code in order to avoid going to next step when it fails
- Added a new type of error to differentiate from other errors and also be able to capture additional data. Logic and styling subject to change, encapsulated inside Logger.

Test Plan:
----------

Here's how the error messages look before/now:

While try to build a project with a wrong "schema" :

Before:
<img width="882" alt="screenshot 2019-01-31 at 18 07 43" src="https://user-images.githubusercontent.com/2464966/52071369-200a4c00-2583-11e9-8700-28766daae122.png">

After:
<img width="880" alt="screenshot 2019-01-31 at 18 05 23" src="https://user-images.githubusercontent.com/2464966/52071244-d91c5680-2582-11e9-83e7-e9e549a570cc.png">

While building a project that has a typo in "AppDelegate.m":

Before:
<img width="885" alt="screenshot 2019-01-31 at 18 08 19" src="https://user-images.githubusercontent.com/2464966/52071411-344e4900-2583-11e9-8613-96ddf6c68006.png">

After:
<img width="886" alt="screenshot 2019-01-31 at 18 06 36" src="https://user-images.githubusercontent.com/2464966/52071300-f6e9bb80-2582-11e9-9c9f-3a4b67318119.png">

You can try it out by running `run-ios` command on a broken project (typo, wrong configuration) or by passing a non-existing `schema`
@mschipperheyn
Copy link

Obviously, compilation failed. But a little helpful context, goes a long way.
An application bundle was not found at the provided path. WHICH path? Just so we can perhaps easily debug a path problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working command: run-ios
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants