0

I am doing a eas build of react-native app made with expo. Getting this error

☁ react-native-news-app [main] ⚡ eas build ★ eas-cli@3.10.2 is now available. To upgrade, run npm install -g eas-cli. Proceeding with outdated version.

✔ Select platform › All
EAS project not configured.
✔ Existing EAS project found for @chimiwangchukwangdi/news-app (id = 70297aaf-289f-4e8b-bcb2-fa1b7e866003). Configure this project? … yes

Warning: Your project uses dynamic app configuration, and the EAS project ID can't automatically be added to it.
https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs

To complete the setup process, set "extra.eas.projectId" in your app.config.ts or app.json:

{
  "expo": {
    "extra": {
      "eas": {
        "projectId": "70297aaf-289f-4e8b-bcb2-fa1b7e866003"
      }
    }
  }
}

✖ Linking local project to EAS project 70297aaf-289f-4e8b-bcb2-fa1b7e866003
Cannot automatically write to dynamic config at: app.config.ts
    Error: build command failed.

Not able to build.

I tried setting up the set "extra.eas.projectId" in my app.json and then again running the command eas build but it fails again giving the same error.

cWW
  • 29
  • 3

1 Answers1

-1

I had been adding "extra.eas.projectId" to my app.json file but the error didnt resolve. So I tried adding the "extra.eas.projectId" to the app.config.ts file and the error was resolved.

I am not sure why and how it worked. Maybe someone can comment on it.

You also need to add your "android.package" and "ios.bundleIdentifier" if your building for ios in your app.config.ts file like this:

import "dotenv/config"; export default {   extra: {
BASE_API_URL: process.env.BASE_API_URL,
BASE_API_PUSH_URL: process.env.BASE_API_PUSH_URL,
API_KEY_NEWSAPI: process.env.API_KEY_NEWSAPI,
API_KEY_NEWSDATA: process.env.PI_KEY_NEWSDATA,
eas: {
  projectId: "70297aaf-289f-4e8b-bcb2-fa1b7e866003",
},   },   android: {
adaptiveIcon: {
  foregroundImage: "./assets/adaptive-icon.png",
  backgroundColor: "#ffffff",
},
package: "example.expo.googlesignin",
googleServicesFile: "./google-services.json",   },   ios: {
supportsTablet: true,
bundleIdentifier: "example.expo.googlesignin",
config: {
  googleSignIn: {
    reservedClientId: "<YOUR_REVERSED_IOS_CLIENT_ID>",
  },
},
googleServicesFile: "./GoogleService-Info.plist",   }, };
cWW
  • 29
  • 3