Full example of app.json


#1

Can we get a full example of app.json?

For instance, when I first uploaded my expo app to the Apple App Store and Google Play, I didn’t include versionCode. But the second time I had to. And I got a CFBundleVersion error when uploading to iTunes Connect too. So I ended up having to spend over an hour building multiple times via exp, and multiple uploads with errors… just for some json validation. Seems like a waste of time for some obvious things.

For instance, for each of these keys, the documentation should have format. For instance - string or number.

I know there are some of these little threads online about how to fix these issues, but why debug when the documentation should just be more complete.

Here are the 3 I have issues with:
android: versionCode (integer, one greater than the last one uploaded)
ios:buildNumber (users don’t see this, and will be used as exactly what in the info.plist?)
version:

Again - all strings? numbers? decimals allowed? integers only?

Would be awesome to have a few json files with really great examples. Or even a JSON validator run before you run exp build:ios etc


#2

Hey @poppopllc ! Here is an example of an App.json. I’m so sorry about our failures here. I promise we’ll get better.

{
  "expo": {
    "name": "<YOUR_NAME>",
    "icon": "./assets/icons/app-icon.png",
    "version": "1.0.0",
    "slug": "<YOUR_SLUG>",
    "sdkVersion": "20.0.0",
    "orientation": "portrait",
    "primaryColor": "#000000",
    "notification": {
      "icon": "./assets/icons/notification-icon.png",
      "color": "#000000",
    },
    "androidStatusBarColor":  "#000000",
    "loading": {
      "icon": "./assets/icons/loading-icon.png",
      "backgroundColor": "#000000",
      "hideExponentText": true,
      "splash": {
        "backgroundColor": "#000000",
      }
    },
    "ios": {
      "bundleIdentifier": "com.apk.<YOUR_VARIABLE>"
    },
    "android": {
      "package": "com.apk.<YOUR_VARIABLE>"
    }
  }
}

I don’t see where versionCode and buildNumber would be in the App.json

Meanwhile I really like using this resource to make sure you have everything checked off.

I hope this helps, this should be all you need?


#3

Good stuff! Thanks for sharing.


#4

what about configuring info.plist with app.json? can you give an example


#5

hey, so it looks like you can add custom keys and values to the autogenerated info.plist file. the best place to see the syntax is probably documented by apple.

in a quick search i found this code example (under see the source code) which you can probably turn into a js object and be good