Manifest string is not a valid json object or string

I’m having trouble generating a proper eas.json script for my app to export.
Anyone who can help?

(P.S.) here’s my eas.json code:

{
  "cli": {
    "version": ">= 2.1.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

I’ve tried reading the documentation:

but it does not have an example code to use for filling in my eas.json file.

( eas-cli/2.1.0 darwin-arm64 node-v18.0.0)

Here is my work in progress

{
  "cli": {
    "version": ">= 0.45.1"
  },
  "build": {
    "production": {
      "releaseChannel": "production",
      "env": {
        "CAREFOR_EMAR_ENVIRONMENT": "production"
      }
    },
    "pre-production": {
      "releaseChannel": "production",
      "env": {
        "CAREFOR_EMAR_ENVIRONMENT": "production"
      },
      "android": {
        "buildType": "apk"
      }
    },
    "development": {
      "extends": "pre-production",
      "developmentClient": true,
      "distribution": "internal",
      "env": {
        "CAREFOR_EMAR_ENVIRONMENT": "development"
      }
    },
    "staging": {
      "extends": "pre-production",
      "distribution": "internal",
      "releaseChannel": "staging",
      "env": {
        "CAREFOR_EMAR_ENVIRONMENT": "staging"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

Hi @markcash11

If you delete eas.json and run eas build for the first time, it will create a default eas.json for you. Yours looks like the one that would be created by default. Are you having problems building or submitting your app?

I don’t know what you mean “for my app to export”?

Hey @markybry, thank you for the support!
It still gives the same error, maybe writing my own EAS.json file would fix this, but
have no Idea how to do this…
Any suggestions would be helpful…

Have you checked for any non printable characters are line ends for example. I assume it is valid JSON at least?

What error do you get? Are you trying to get a build to download on a device or submit to an app store?

have you tried running the following command to build your APK. Assuming you have a staging profile

"staging": {
      "releaseChannel": "staging",
   
      "android": {
        "buildType": "apk"
      }
    },

eas build --platform android --profile staging

Trying this now, however, the error still reads: “Uncaught Error: java.io.IOException: Manifest string is not a valid JSONObject or JSONArray.” OK

00:33:10 Fatal Error

My EAS.Json file now looks like this:

{
  "cli": {
    "version": ">= 0.52.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {},
    
    "staging": {
      "releaseChannel": "staging",

      "android": {
        "buildType": "apk"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

In terminal I’m saying:
eas build --profile staging
to build the app now.

Btw, I found a forum about this same topic which may be useful for some people:

Any chance you could create a repo with a minimal reproduction of the issue and I will give it a try.

I’m sorry if this is incomplete, I’m new to creating repositories, but this should be the full app.

And then I start the app with expo start
and build the app with eas build --profile staging

Hope this helps!

Hi @markcash11

Let’s take a step back.

Could you run npx expo-env-info from the terminal while you are in the root of your project and paste the results here?

Is this a newly created app or one you upgraded? Did you build it successfully in the past? If so, how did you build it before?

What do you get if you run expo-cli doctor?

Also, as a test, what happens if you create a new app (obviously do not run this inside your existing project :slight_smile:) and then build it. Use the blank@sdk-44 template, since your real app is using SDK 44:

npx create-expo-app new-app -- --template blank@sdk-44
cd new-app
eas build -p android --profile preview

Do you get the same error? If so, at what point do you get the error and where do you see it?
Is that the whole error message or is there more info displayed as well?
If there’s more than just what’s in the title of this thread, please paste the whole message here.

Unrelated to your build problems, do you have your project committed to a local Git repository on your machine? If not, it would be a good idea :slight_smile:

Ran expo-env-info in my root project and this is what I get:

expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 12.3.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.18.0 - /usr/local/bin/node
      npm: 8.6.0 - /opt/homebrew/bin/npm
      Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    IDEs:
      Android Studio: 2021.3 AI-213.7172.25.2113.9014738
      Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
    npmPackages:
      expo: ~44.0.0 => 44.0.6 
      react: 17.0.1 => 17.0.1 
      react-dom: 17.0.1 => 17.0.1 
      react-native: 0.64.3 => 0.64.3 
      react-native-web: 0.17.1 => 0.17.1 
    npmGlobalPackages:
      eas-cli: 2.4.1
      expo-cli: 6.0.6
    Expo Workflow: managed

Hope this is helpful

This is what I get when I run expo-cli doctor:

markcash@Marks-MacBook-Air doApp % expo-cli doctor
🎉 Didn't find any issues with the project!

Hello @wodin, thanks a lot for the explanation, everything seems fine with my project and
if I follow the steps you described (npx create-expo-app new-app)
I get exactly this error on my expo app:

Uncaught Error: java.io.IOException: Manifest string is not a valid JSONObject or JSONArray: OK
16:11:48 Fatal Error

I thus think it has something to do with my expo-app rather than the code, thanks for the help. I think we’re getting somewhere now…

Hi

Thanks for the info.

Could you go into a bit more detail, please?

Are you saying that the response to running npx create-expo-app new-app is the error message you quoted?

Also, the way you said it was a bit confusing to me. I’m not sure what you mean by “my expo app”. Where exactly do you see the error? In the terminal window where you ran the npx create-expo-app new-app command?

Perhaps you can write out step by step what you are doing and what happens as a result and where you see the result?

Yes, I can certainly clarify!
This is what I run inside the console:

npx create-expo-app new-app -- --template blank@sdk-44
cd new-app
eas build -p android --profile preview

The following output is generated:

✔ Build finished

🤖 Android app:
https://expo.dev/artifacts/eas/t2n5GWti3pNe8ewBuz2QsR.aab

However, when opening this link on my mobile phone and running the application
with the ‘expo-go app’ (Expo) , I see the following error on my screen (inside the expo-go app):

Uncaught Error: java.io.IOException: Manifest string is not a valid JSONObject or JSONArray: OK
16:11:48 Fatal Error

This error thus occurs on my mobile phone and it might be due to my phone (a Motorola moto e20) being too outdated/old. What do you think?