EAS build failed / Expo managed workflow: Execution failed for task ':app:bundleReleaseJsAndAssets'

There was a problem on running command
eas build --platform android --profile production_android

This is the error log from the expo.dev, in “Run gradlew” section

[stderr] error While resolving module `ndc-ministry/environment`, the Haste package `ndc-ministry` was found. However the module `environment` could not be found within the package. Indeed, none of these files exist:
[stderr] * `/home/expo/workingdir/build/environment(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)`
[stderr]* `/home/expo/workingdir/build/environment/index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)`.
Error: While resolving module `ndc-ministry/environment`, the Haste package `ndc-ministry` was found. However the module `environment` could not be found within the package. Indeed, none of these files exist:
* `/home/expo/workingdir/build/environment(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)`
* `/home/expo/workingdir/build/environment/index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)`
    at resolveHasteName (/home/expo/workingdir/build/node_modules/metro-resolver/src/resolve.js:255:9)
    at Object.resolve (/home/expo/workingdir/build/node_modules/metro-resolver/src/resolve.js:116:20)
    at ModuleResolver.resolveDependency (/home/expo/workingdir/build/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:187:31)
    at DependencyGraph.resolveDependency (/home/expo/workingdir/build/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
    at Object.resolve (/home/expo/workingdir/build/node_modules/metro/src/lib/transformHelpers.js:317:42)
    at resolve (/home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:629:33)
    at /home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:645:26
    at Array.reduce (<anonymous>)
    at resolveDependencies (/home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:644:33)
    at /home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:329:33
info Run CLI with --verbose flag for more details.
> Task :app:bundleReleaseJsAndAssets FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:bundleReleaseJsAndAssets'.

This error was not expected because it run well in Expo go for years, and we had this code running with expo build without any issues for a long time. I tried to reinstall node_modules using npm or yarn, but it produces same error.

The project uses managed workflow
Dependency:

  • expo-cli 5.4.7
  • eas-cli/0.53.0 win32-x64 node-v16.14.0

Package.json:

{
  "name": "ndc-ministry",
  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo-google-fonts/inter": "^0.1.0",
    "@expo-google-fonts/judson": "^0.1.0",
    "@expo-google-fonts/montserrat": "^0.1.0",
    "@expo-google-fonts/noto-sans": "^0.1.0",
    "@expo-google-fonts/open-sans": "^0.1.0",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/datetimepicker": "3.5.2",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/netinfo": "6.0.2",
    "@react-native-community/slider": "4.1.12",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/drawer": "^6.1.8",
    "@react-navigation/material-top-tabs": "^6.0.6",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "@unimodules/core": "~7.2.0",
    "@unimodules/react-native-adapter": "~6.5.0",
    "buffer": "^6.0.3",
    "expo": "^43.0.0",
    "expo-analytics": "^1.0.16",
    "expo-analytics-amplitude": "~11.0.3",
    "expo-av": "~10.1.3",
    "expo-barcode-scanner": "~11.1.2",
    "expo-camera": "~12.0.3",
    "expo-clipboard": "~2.0.3",
    "expo-constants": "~12.1.3",
    "expo-crypto": "~10.0.3",
    "expo-dev-client": "~0.6.3",
    "expo-document-picker": "~10.0.3",
    "expo-file-system": "~13.0.3",
    "expo-font": "~10.0.3",
    "expo-image-picker": "~11.0.3",
    "expo-linear-gradient": "~10.0.3",
    "expo-linking": "~2.4.2",
    "expo-location": "~13.0.4",
    "expo-media-library": "~13.0.3",
    "expo-network": "~4.0.3",
    "expo-notifications": "~0.13.3",
    "expo-screen-capture": "^1.0.1",
    "expo-screen-orientation": "~4.0.3",
    "expo-secure-store": "~11.0.3",
    "expo-status-bar": "~1.1.0",
    "expo-store-review": "~5.0.3",
    "expo-tracking-transparency": "~2.0.3",
    "expo-updates": "~0.10.15",
    "lottie-react-native": "4.0.3",
    "moment": "^2.27.0",
    "numeral": "^2.0.6",
    "react": "17.0.1",
    "react-native": "0.64.3",
    "react-native-appearance": "~0.3.3",
    "react-native-base64": "0.0.2",
    "react-native-calendars": "^1.1275.0",
    "react-native-chart-kit": "^6.3.0",
    "react-native-cn-richtext-editor": "^1.0.40",
    "react-native-collapsible": "^1.5.3",
    "react-native-copilot": "^2.5.1",
    "react-native-crypto-js": "^1.0.0",
    "react-native-date-picker": "^4.1.3",
    "react-native-elements": "^3.4.2",
    "react-native-fetch-polyfill": "^1.1.3",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-hyperlink": "0.0.19",
    "react-native-image-slider-box": "^1.0.12",
    "react-native-image-viewing": "^0.2.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-maps": "0.28.1",
    "react-native-modal": "^11.5.6",
    "react-native-multiple-select": "^0.5.3",
    "react-native-otp-textinput": "0.0.5",
    "react-native-pager-view": "5.4.6",
    "react-native-pose": "^0.9.0",
    "react-native-progress": "^4.1.2",
    "react-native-qrcode-svg": "^5.2.0",
    "react-native-ratings": "^7.3.0",
    "react-native-reanimated": "~2.2.0",
    "react-native-render-html": "^4.2.2",
    "react-native-safe-area-context": "3.3.2",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-scalable-image": "^1.1.0",
    "react-native-screens": "~3.8.0",
    "react-native-scroll-into-view": "^1.0.3",
    "react-native-skeleton-content": "^1.0.22",
    "react-native-svg": "12.1.1",
    "react-native-swipe-list-view": "^3.2.3",
    "react-native-tab-view": "^3.1.1",
    "react-native-unimodules": "~0.15.0",
    "react-native-vector-icons": "^9.0.0",
    "react-native-webview": "11.13.0",
    "react-navigation": "^3.11.1",
    "react-navigation-drawer": "^2.5.0",
    "react-navigation-stack": "^2.8.2",
    "react-redux": "^5.1.1",
    "redux": "^4.0.1",
    "redux-persist": "^5.10.0",
    "rn-swipe-button": "^1.2.8",
    "url-parse": "^1.4.7"
  },
  "devDependencies": {
    "@expo/vector-icons": "^12.0.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^5.9.0",
    "eslint-plugin-react": "^7.20.4",
    "react-native-dotenv": "^0.2.0"
  }
}

eas.json:

{
  "cli": {
    "version": ">= 0.52.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {},
    "production_android": {
      "releaseChannel": "production-v33-android"
    },
    "production_ios": {
      "releaseChannel": "production-v33-ios"
    }
  },
  "submit": {
    "production": {}
  }
}

In case you are wondering, I will also provide environment.js that located in the root project folder. This file works as an .env file in projects.

export const ENVIRONMENT = "PRODUCTION"

export const API_ROOT_DEVELOPMENT="https://"
export const API_ROOT_PRODUCTION="https://"
    
export const AMPLITUTE_API_KEY_PRODUCTION="abc"
export const AMPLITUTE_API_KEY_DEVELOPMENT="def"

export const TOKEN="123"

is that file gitignored? fyi/eas-build-archive.md at main · expo/fyi · GitHub

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.