Error on iOS build suggesting BundleID isn't present

Hi all! I am trying to build the iOS file using the command line. I am following the docs, but when running exp build:ios, I get the following error:
_[exp] Your project must have a bundleIdentifier set in exp.json. See https://docs.expo.io/versions/latest/guides/building-standalone-apps.html_

However, I have a bundleID present in the exp.json. Please see below. Thanks for your help.

{
  "name": "foundz",
  "description": "The best tracking tool for lost items",
  "slug": "fitter",
  "privacy": "unlisted",
  "sdkVersion": "16.0.0",
  "ios": {
     "bundleIdentifier": "com.belleandstone.foundz",
   },
   "android": {
     "package": "com.belleandstone.foundz",
   },
  "version": "1.0.0",
...
}

Hi, just double checking, is that file titled exp.json ? (sometimes there is confusion and people have app.json instead.) Also, what is the output of exp --version ?

Hey Ben! yep. it’s the exp.json file. the output of exp --version is 41.0.0

Ok, hmm, that all checks out.

Just fishing around here, can you try removing the trailing comma on single properties? (this is json rather than JS)

  "ios": {
     "bundleIdentifier": "com.belleandstone.foundz", <---
   },
   "android": {
     "package": "com.belleandstone.foundz", <---
   },

Edit: Also, just another question, are you running exp build from the same directory as your exp.json file?

thanks @ben - yeah i’m running it from the same directory as exp.json. i was able to get the android to give me an apk file, but no luck with iOS. I just removed the trailing commas on these, but still getting the same message. so strange right? in the docs i noticed there aren’t quotation marks around the bundleIdentifier. but the default file had it so i kept it in.

Interesting. Nothing obviously wrong stands out to me. I’ve pinged the main person who works on exp.

In the meantime, if this isn’t too much trouble, I wonder what happens on your machine if you create a totally blank expo project, add a bundleIdentifier and minimal configuration, and run exp build:ios for that blank project?

Another random thought-- you didn’t paste the entire contents of exp.json, but do you happen to have a second “ios” property lurking somewhere else in that file by accident?

3 Likes

you’re a genius, a gentleman and a scholar! that was it. I had another iOS property at the bottom that was specifying tablet configuration (essentially only iPhone). This looks to be working now! thanks so much! i really appreciate it.

2 Likes

Glad to figure it out! Good luck with your project! :slight_smile:

1 Like

Experienced the same issue - it was because I had app.json in the repo (created by create-react-native-app) alongside an exp.json. deleted app.json and no longer seeing this error.

Problem is, that now exp start doesn’t work. So I moved app.json aside while building.

Related: https://github.com/expo/expo/issues/170