Could not read script '/' as it is a directory. Expo Android Build via Expo Managed workflow

I’m building my application and facing issues with the Android Play Store build while the internal Android build works fine with the following command.

Also I’m building via expo managed workflow

eas build --platform android --profile production

I’m getting the following error log.

Running 'gradlew :app:bundleRelease' in /home/expo/workingdir/build/androidDownloading https://services.gradle.org/distributions/gradle-7.5.1-all.zip10%.20%.30%.40%50%.60%70%.80%.90%.100%
Welcome to Gradle 7.5.1!
Here are the highlights of this release:
 - Support for Java 18
 - Support for building with Groovy 4
 - Much more responsive continuous builds
 - Improved diagnostics for dependency resolution
For more details see honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
FAILURE:Build failed with an exception.
* Where:
Settings file '/home/expo/workingdir/build/android/settings.gradle' line: 6
* What went wrong:
A problem occurred evaluating settings ''.
> **Could not read script '/' as it is a directory.**
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at BUILD FAILED in 14s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

I have the following configurations on my local machine.

System:
    OS: macOS 13.4.1
    CPU: (8) arm64 Apple M1
    Memory: 564.08 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.4 - ~/Desktop/node_modules/.bin/npm
    Watchman: 2023.10.09.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.13.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.3 AI-223.8836.35.2231.10811636
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.21 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.14 => 0.71.14 
    react-native-macos: Not Found
  npmGlobalPackages:
    react-native: Not Found

I’ve tried upgrading and downgrading expo SDK and eas CLI as well. Still no luck :frowning:

Getting same error. Kindly update asap.

Hi @hasan.shahid

Please run npx expo-env-info and npx expo-doctor and paste the results here?

What command did you run to generate the above-mentioned build?

npx expo-env-info

  expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 13.4
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.13.0 - /usr/local/bin/node
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 8.19.4 - ~/Documents/dev/node_modules/.bin/npm
      Watchman: 2023.10.09.00 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    IDEs:
      Android Studio: 2022.1 AI-221.6008.13.2211.9477386
      Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
    npmPackages:
      babel-preset-expo: ^9.3.0 => 9.5.2 
      expo: ^48.0.0 => 48.0.20 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.71.14 => 0.71.14 
    npmGlobalPackages:
      eas-cli: 5.5.0
    Expo Workflow: managed

npx expo-doctor

OK. Looks like you have some conflicting dependencies. Please post your dependencies and devDependencies from package.json. Also any overrides/resolutions if you have them.

  "dependencies": {
    "@babel/eslint-parser": "^7.15.0",
    "@emotion/core": "^10.0.17",
    "@emotion/native": "^10.0.14",
    "@emotion/react": "^11.1.2",
    "@emotion/styled": "^11.0.0",
    "@expo/config": "~8.0.0",
    "@expo/config-plugins": "~6.0.0",
    "@expo/prebuild-config": "~6.0.2",
    "@expo/vector-icons": "^13.0.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.30",
    "@fortawesome/free-brands-svg-icons": "^5.15.1",
    "@fortawesome/free-solid-svg-icons": "^5.14.0",
    "@fortawesome/pro-light-svg-icons": "^5.14.0",
    "@fortawesome/pro-regular-svg-icons": "^5.14.0",
    "@fortawesome/pro-solid-svg-icons": "^5.14.0",
    "@fortawesome/react-native-fontawesome": "^0.2.5",
    "@react-native-async-storage/async-storage": "1.17.11",
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/datetimepicker": "6.7.3",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/netinfo": "9.3.7",
    "@react-navigation/bottom-tabs": "^5.11.7",
    "@react-navigation/compat": "^5.3.13",
    "@react-navigation/drawer": "^5.12.3",
    "@react-navigation/native": "^5.9.2",
    "@react-navigation/stack": "^5.14.2",
    "@react-navigation/tabs": "^0.0.0-alpha.12",
    "@rneui/base": "^4.0.0-rc.6",
    "@rneui/themed": "^4.0.0-rc.6",
    "@sentry/integrations": "^5.17.0",
    "@sentry/react-native": "4.15.2",
    "@storybook/addon-console": "^1.2.2",
    "@storybook/addon-essentials": "^6.1.11",
    "accordion-collapse-react-native": "^1.0.0",
    "axios": "^0.19.0",
    "axios-hooks": "^1.9.0",
    "connected-react-router": "^6.4.0",
    "date-fns": "^2.16.1",
    "deprecated-react-native-prop-types": "2.2.0",
    "emotion-theming": "^10.0.17",
    "expo": "^48.0.0",
    "expo-app-loading": "~2.1.1",
    "expo-application": "~5.1.1",
    "expo-asset": "~8.9.1",
    "expo-build-properties": "~0.6.0",
    "expo-constants": "~14.2.1",
    "expo-device": "~5.2.1",
    "expo-firebase-analytics": "~8.0.0",
    "expo-firebase-core": "~6.0.0",
    "expo-font": "~11.1.1",
    "expo-linking": "~4.0.1",
    "expo-network": "~5.2.1",
    "expo-permissions": "~14.1.1",
    "expo-secure-store": "~12.1.1",
    "expo-splash-screen": "~0.18.2",
    "expo-store-review": "~6.2.1",
    "expo-updates": "~0.16.4",
    "expo-web-browser": "~12.1.1",
    "jwt-decode": "^2.2.0",
    "lodash": "^4.17.11",
    "moment": "^2.26.0",
    "patch-package": "^6.4.7",
    "postinstall-postinstall": "^2.1.0",
    "prop-types": "^15.7.2",
    "react": "18.2.0",
    "react-async-hook": "^3.6.1",
    "react-dom": "18.2.0",
    "react-native": "0.71.14",
    "react-native-animatable": "^1.3.3",
    "react-native-form-validator": "^0.2.0",
    "react-native-gesture-handler": "~2.9.0",
    "react-native-modal-datetime-picker": "^7.5.0",
    "react-native-paper": "^3.9.0",
    "react-native-percentage-circle": "chenzhizhen/react-native-percentage-circle#master",
    "react-native-picker-select": "^6.2.0",
    "react-native-progress": "~4.1.2",
    "react-native-reanimated": "~2.14.4",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "4.5.0",
    "react-native-screens": "~3.20.0",
    "react-native-svg": "13.4.0",
    "react-native-svg-charts": "^5.4.0",
    "react-native-swiper": "^1.5.14",
    "react-native-webview": "11.26.0",
    "react-native-youtube-iframe": "^2.2.2",
    "react-redux": "^7.2.3",
    "react-router": "^5.0.1",
    "redux": "^4.0.1",
    "redux-axios-middleware": "^4.0.0",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "sentry-expo": "~6.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/plugin-proposal-decorators": "^7.4.4",
    "@babel/plugin-proposal-export-default-from": "^7.5.2",
    "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
    "@babel/plugin-proposal-optional-chaining": "^7.2.0",
    "@babel/plugin-transform-flow-strip-types": "^7.4.4",
    "@babel/plugin-transform-object-assign": "^7.2.0",
    "@babel/plugin-transform-react-display-name": "^7.2.0",
    "@babel/plugin-transform-react-jsx": "^7.3.0",
    "@babel/plugin-transform-react-jsx-source": "^7.5.0",
    "@commitlint/cli": "^17.3.0",
    "@commitlint/config-conventional": "^17.3.0",
    "@react-native-community/cli-platform-android": "8.0.4",
    "@semantic-release/changelog": "^6.0.2",
    "@semantic-release/commit-analyzer": "^9.0.2",
    "@semantic-release/git": "^10.0.1",
    "@semantic-release/github": "^8.0.7",
    "@semantic-release/npm": "^9.0.1",
    "@semantic-release/release-notes-generator": "^10.0.3",
    "@storybook/addon-actions": "5.3.18",
    "@storybook/addon-links": "5.3.18",
    "@storybook/addon-ondevice-actions": "^5.3.23",
    "@storybook/addons": "^6.1.11",
    "@storybook/react-native": "5.3.18",
    "@storybook/react-native-server": "5.3.18",
    "@storybook/theming": "^6.1.11",
    "@testing-library/react-native": "^7.2.0",
    "@types/enzyme": "^3.10.8",
    "@types/jest": "^26.0.23",
    "@types/lodash": "^4.14.170",
    "@types/react": "~18.0.27",
    "@types/react-native-htmlview": "^0.12.3",
    "@typescript-eslint/eslint-plugin": "^4.29.0",
    "@typescript-eslint/parser": "^2.15.0",
    "babel-jest": "^27.0.2",
    "babel-loader": "^8.1.0",
    "babel-preset-expo": "^9.3.0",
    "enzyme": "^3.11.0",
    "enzyme-adapter-react-16": "^1.15.6",
    "eslint": "^6.8.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-config-airbnb-typescript": "^12.3.1",
    "eslint-config-universe": "^2.1.0",
    "eslint-plugin-import": "^2.20.0",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.18.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "husky": "^8.0.2",
    "jest": "^29.2.1",
    "jest-expo": "^46.0.0",
    "react-native-debugger-open": "^0.3.24",
    "react-native-ratings": "^8.1.0",
    "semantic-release": "^19.0.5",
    "semantic-release-expo": "^2.2.3",
    "typescript": "^4.9.4"
  },
  "private": true,
  "release": {
    "branches": [
      "master",
      "staging"
    ],
    "verifyConditions": [
      "semantic-release-expo",
      "@semantic-release/git",
      "@semantic-release/github"
    ],
    "analyzeCommits": [
      [
        "@semantic-release/commit-analyzer",
        {
          "preset": "conventionalcommits"
        }
      ]
    ],
    "generateNotes": [
      [
        "@semantic-release/release-notes-generator",
        {
          "preset": "conventionalcommits"
        }
      ]
    ],
    "prepare": [
      "semantic-release-expo",
      "@semantic-release/changelog",
      "@semantic-release/npm",
      {
        "path": "@semantic-release/git",
        "assets": [
          "CHANGELOG.md",
          "package.json",
          "yarn.lock",
          "app.json"
        ],
        "versions": {
          "version": "${next.raw}",
          "android": "${code}",
          "ios": "${next.raw}"
        }
      }
    ],
    "publish": false,
    "success": false,
    "fail": false
  },
  "publishConfig": {
    "access": "restricted"
  }
}```

Really appreciate the help

@hasan.shahid did you resolve the issue, i am facing the same

No, waiting on @wodin to bring some good news :eyes:

1 Like

While you wait, try reading the troubleshooting guide:

BTW, it’s 8:30 pm here and I do this in my free time.

Do hou need this?

You shouldn’t need these.

This is deprecated. You should switch to react-native-masked-view/masked-view

Do you need this?

This is either deprecated or removed already. Check the Expo SDK release blog posts.

Sane with these.

Do you need this?