app.json must include a JSON object

Getting this error when running expo publish in GitHub Actions

[06:12:05] Unable to find an existing Expo CLI instance for this directory, starting a new one...
[06:12:05] app.json must include a JSON object.
[06:12:05] Set EXPO_DEBUG=true in your env to view the stack trace.

Hi

Can you post your app.json? (You can obscure any API keys etc.)

Are you running expo publish in the root of the project?

Im seein the same issue.
app.json:

{
  "expo": {
    "name": "my-app",
    "description": "",
    "slug": "my-app",
    "privacy": "public",
    "sdkVersion": "35.0.0",
    "platforms": ["android", "ios"],
    "version": "1.11.2",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "androidStatusBar":{
      "backgroundColor": "#33aab7"
    },
    "assetBundlePatterns": ["**/*"],
    "packagerOpts": {
      "assetExts": ["html"]
    },
    "ios": {
      "bundleIdentifier": "com.my.app",
      "supportsTablet": false,
      "buildNumber": "19",
      "infoPlist": {
        "NSCameraUsageDescription": "This app uses the camera to scan barcodes."
      }
    },
    "android": {
      "package": "com.my.app",
      "versionCode": 19
    }
  }
}

hmmm… your app.json looks like JSON to me :sweat_smile:

Can you please run expo diagnostics in the same directory where you ran the command that gave you this error and then paste the output here? Also, what command, exactly, did you run to get this error?

I’m having the same issue after upgrading the expo-cli to 3.11.3

As I said in my previous comment:

Here’s the output:


  Expo CLI 3.11.3 environment info:
    System:
      OS: macOS 10.15.2
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.17.0 - ~/.nvm/versions/node/v10.17.0/bin/node
      Yarn: 1.17.0 - /usr/local/bin/yarn
      npm: 6.11.3 - ~/.nvm/versions/node/v10.17.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5314842
      Xcode: 11.3/11C29 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^35.0.0 => 35.0.0 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8 
      react-navigation: ^3.8.1 => 3.8.1 
    npmGlobalPackages:
      expo-cli: 3.11.3

The following command I used to make a build

expo build:android release-channel testing

Thanks. What do you get if you run the following?

python -mjson.tool app.json >/dev/null && echo OK

Also, does it make a difference if you use --release-channel testing instead of release-channel testing?

Actually I’ve just tried it myself. Leaving out the β€œ--” does indeed cause this error.

I have the same issue but it happens when I run expo upload:ios

The weird thing is that when I run expo diagnostics it says I’m using expo-cli 3.11.1 but I’m actually on 3.8.0

Expo CLI 3.8.0 environment info:
    System:
      OS: macOS 10.15.2
      Shell: 3.0.2 - /usr/local/bin/fish
    Binaries:
      Node: 12.12.0 - /usr/local/bin/node
      Yarn: 1.19.1 - /usr/local/bin/yarn
      npm: 6.11.3 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.6010548
      Xcode: 11.3/11C29 - /usr/bin/xcodebuild
    npmPackages:
      @types/react: ^16.8.23 => 16.9.4
      @types/react-native: ^0.57.65 => 0.57.65
      expo: ^35.0.0 => 35.0.0
      react: 16.8.3 => 16.8.3
      react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8
      react-navigation: ^4.0.10 => 4.0.10
    npmGlobalPackages:
      expo-cli: 3.11.1
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                                                                                          β”‚
β”‚   There is a new version of expo-cli available (3.11.3).                                                                                 β”‚
β”‚   You are currently using expo-cli 3.8.0                                                                                                 β”‚
β”‚   Install expo-cli globally using the package manager of your choice; for example: `npm install -g expo-cli` to get the latest version   β”‚
β”‚                                                                                                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

It looks like you have two versions of expo-cli installed. e.g. one installed by yarn and one installed by npm. I suggest you uninstall the one you are not expecting. Also make sure you don’t have expo-cli installed as an actual dependency in your package.json.

What is the exact expo upload:ios command you are running when you get that error and are you in the app’s root directory when running it? Also, what does the following print?

python -mjson.tool app.json >/dev/null && echo OK

I was running expo upload:ios EXPO_APPLE_ID=myUser EXPO_APPLE_PASSWORD=password

python -mjson.tool app.json >/dev/null && echo OK

prints OK

I don’t have the expo-cli in my packages.json and I only installed using yarn

OK nvm, I re installed the explo-cli and now it’s working. Btw actually what I wrote before is wrong, to set the apple id I use --apple-id-password. Before I wasn’t setting the apple id and I was still getting the error.

Anyway, the error is gone now

1 Like