Error on iOS build suggesting BundleID isn't present


#1

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",
...
}

#2

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 ?


#3

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


#4

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?


#5

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.


#6

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?


#7

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?


#8

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.


#9

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


#10

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