11

I am attempting to build my first iOS app using this repo: https://github.com/pmusaraj/discourse-mobile-single-site-app

When building, I receive an error and cannot move forward. I am an absolute noob who will spend long hours on this, but have no idea if I’ve reached a point of failure in the code that I can move beyond with some simple tweaking, or if I must wait for my Issue (opened on the repo) to be resolved by the dev. I assume the dev is busy with other projects and may not have time to help.

Perhaps my software is too new for this? Should I try versioning back react-native and XCode? I could downgrade to XCode 9.2 (Dec 2017 to March 2018 version) and react-native to 0.53.0 (January 2018 version).
My machine:
Mac OSX: 10.14.6
react-native-cli: 2.0.1
react-native: 0.58.6
XCode: 10.3 (build 10G8)

Issue: The info.plist file is not playing nicely with the builder. Inside /ios/DiscoSingle/Info.plist, I see CFBundleIdentifier properly defined as:

<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>

This looks correct to me.

Here’s the error when running react-native ios-build:

The following build commands failed:
    Ld /Users/user919021/Desktop/discourse/ios/build/Build/Products/Debug-iphonesimulator/DiscoSingle.app/DiscoSingle normal x86_64
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/DiscoSingle.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

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


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

    at checkExecSyncError (child_process.js:629:11)
    at Object.execFileSync (child_process.js:647:13)
    at Promise.then (/Users/user919021/Desktop/discourse/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
    at process._tickCallback (internal/process/next_tick.js:68:7)
waffleslop
  • 113
  • 1
  • 1
  • 5
  • Are you using any runscripts? – Mojtaba Hosseini Aug 03 '19 at 20:03
  • Mojtaba, I’m not familiar with that term. I couldn’t find much on Google. Can you provide more detail? I’m following the repo instructions to the letter and am receiving the above error. – waffleslop Aug 03 '19 at 22:04
  • https://fantashit.com/cfbundleidentifier-does-not-exist/ – MartianMartian Jan 11 '22 at 05:47
  • How is this possible? I haven't touched the project for over a year and I get this issues. – Gene M Jan 12 '22 at 16:38
  • What ended up being my problem was that the GoogleService-Info (and potentially LaunchScreen) were no longer properly added to the project in Xcode. I just re-added them (right click on project folder, add file) and it built. Frustrating because the error was so unhelpful, sharing here in case it helps someone else. – Sara Inés Calderón Jun 02 '22 at 17:35

8 Answers8

6

From my experience, the Bundle Identifier name in your git, was forgot to fill. so, you must add that bundle identifier name in info plist> Signing & capabilities. You can add something like: com.habiesmart.myapps, etc. Just like that, and eureka! you can run that project!

this image may help you

Best, Habie.

Habie Smart
  • 139
  • 1
  • 9
4

Error cause: In my case, I moved the info.plist which broke the build. The error continued to occur after moving the info.plist back.

Solution: Everything regarding bundle appeared to be correct. The fix was to change an unrelated entry in the info.plist and run the build. This caused the process to correct itself. Then I set the changed info.plist entry back to its original setting and again, the build ran successfully.

(FWIW, I picked "Application supports indirect input..." to change)

Marcy
  • 4,611
  • 2
  • 34
  • 52
4

In my case everything was correct in Info.plist file. Bundle identifier were also there for respective environments. Issue was with GoogleService-Info.plist file. It was missing at given path.

Ravi
  • 34,851
  • 21
  • 122
  • 183
  • This fixed my issue, some how GoogleService-Info.plist was being read from my download folder and not in the project – Onalo Joseph Aug 29 '22 at 11:43
2

For those still having the same issues you probably moved your info.plist file you need to tell Xcode where to find it go to build settings and ensure the correct path for the info.plist file is stated there. Here is an image:
here is an image

Dharman
  • 30,962
  • 25
  • 85
  • 135
eloka
  • 95
  • 7
1

In my case, it was something with my main storyboard or launch screen. I think I deleted them on the file system and then tried to build a project but got the error at the end. After I deleted those files in the Xcode project and added them back it started to run on a simulator.

Anton Plebanovich
  • 1,296
  • 17
  • 17
1

It could be multiple reason For below is worked

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
}

Added bundle identifier in Info.plist & error gone.

Project->Info.plist->Open as source code

<key>CFBundleIdentifier</key>
<string>com.CompanyName.movies</string>
Jack
  • 13,571
  • 6
  • 76
  • 98
0

Sometime it's a little bit strange, in my case I suggest we check our project directory in finder because sometime our plist file doesn't stay inside the right directory as we set inside our Project Build Setting so Xcode doesn't be able to locate that plist file, and because of that compiler will show this error.

This was my problem I try to figure this out for almost 30 min, then I decide to open my project directory, and I see that the plist file didn't stay inside the right directory as I set inside Project Build Setting.

This happen because I tried to separate Project Target Schema.

Hope this help someone who face this problem and can't figure it out like me too.

0

I found that while there was an Info.plist file in the directory with the App declaration I mustn't be adding properties there but rather need to click the project title on the left pane to access the project navigator, then, select my target, then, select "build settings" and scroll down to Info.plist values.

Luke Walsh
  • 281
  • 1
  • 7