react-nativegradleexpococoapodseas

EAS Build Fails with "spawn pod ENOENT" for iOS and "no such file or directory" for Android


Problem Description

I'm trying to build my Expo React Native project using EAS Build, but I'm encountering errors for both iOS and Android builds.

For iOS, I get:

spawn pod ENOENT

For Android, I get:

ENOENT: no such file or directory, open '/home/expo/workingdir/build/android/gradlew'

Details

The weird thing is that both ios and android folders exist in my project with the correct files:

iOS directory contains:

Android directory contains:

But when trying to build via EAS, it seems like the build process can't locate these files within the build environment.

What I've Tried

  1. I ran expo prebuild to generate the native projects
  2. I cleaned the iOS pods by going into the iOS directory:
    cd ios
    pod cache clean --all
    rm -rf Pods
    rm -rf Podfile.lock
    pod install
    
  3. I updated the Podfile to fix DEFINES_MODULE warnings:
    # DEFINES_MODULE warnings fix
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['DEFINES_MODULE'] = 'YES'
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = ''
      end
    end
    
  4. I tried both cloud and local builds:
    eas build --platform ios --profile development
    eas build -p ios --local
    

But I still get the same errors.

My Environment

EAS CLI Details

ā˜… eas-cli@16.0.0 is now available.
To upgrade, run:
npm install -g eas-cli
Proceeding with outdated version.

eas-cli/15.0.15 darwin-arm64 node-v22.14.0

Package.json Expo Dependencies

    "expo": "~52.0.38",
    "expo-blur": "~14.0.3",
    "expo-camera": "~16.0.18",
    "expo-constants": "~17.0.7",
    "expo-dev-client": "~5.0.14",
    "expo-device": "~7.0.2",
    "expo-file-system": "~18.0.11",
    "expo-font": "~13.0.4",
    "expo-haptics": "~14.0.1",
    "expo-image": "~2.0.6",
    "expo-image-manipulator": "~13.0.6",
    "expo-image-picker": "~16.0.6",
    "expo-linear-gradient": "~14.0.2",
    "expo-linking": "~7.0.5",
    "expo-location": "~18.0.8",
    "expo-media-library": "~17.0.6",
    "expo-notifications": "~0.29.14",
    "expo-router": "~4.0.19",
    "expo-sharing": "~13.0.1",
    "expo-splash-screen": "~0.29.22",
    "expo-status-bar": "~2.0.1",
    "expo-symbols": "~0.2.2",
    "expo-system-ui": "~4.0.8",
    "expo-updates": "~0.27.4",
    "expo-web-browser": "~14.0.2",

Environment Info

  expo-env-info 1.2.2 environment info:
    System:
      OS: macOS 15.3.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 22.14.0 - /usr/local/bin/node
      npm: 10.9.2 - /usr/local/bin/npm
    Managers:
      CocoaPods: 1.16.2 - /Users/batuhan/.gem/ruby/3.4.0/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.2, iOS 18.2, macOS 15.2, tvOS 18.2, visionOS 2.2, watchOS 11.2
    IDEs:
      Xcode: 16.2/16C5032a - /usr/bin/xcodebuild
    npmPackages:
      expo: ~52.0.38 => 52.0.39 
      expo-router: ~4.0.19 => 4.0.19 
      react: 18.3.1 => 18.3.1 
      react-dom: 18.3.1 => 18.3.1 
      react-native: 0.76.7 => 0.76.7 
      react-native-web: ~0.19.13 => 0.19.13 
    npmGlobalPackages:
      eas-cli: 15.0.15
    Expo Workflow: bare

EAS Configuration

eas.json:

{
  "cli": {
    "version": ">= 7.3.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "development-simulator": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "simulator": true
      }
    },
    "preview": {
      "distribution": "internal",
     "channel": "preview"
    },
    "production": {
      "channel": "production"
    }
  },
  "submit": {
    "production": {}
  }
}

app.json:

{
  "expo": {
    "name": "digital-closet",
    "slug": "digital-closet",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "scheme": "digital-closet",
    "userInterfaceStyle": "automatic",
    "newArchEnabled": true,
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.ozkanerbatuhan.digitalcloset",
      "infoPlist": {
        "ITSAppUsesNonExemptEncryption": false
      }
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/images/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.ozkanerbatuhan.digitalcloset",
      "permissions": [
        "android.permission.CAMERA",
        "android.permission.RECORD_AUDIO",
        "android.permission.READ_EXTERNAL_STORAGE",
        "android.permission.WRITE_EXTERNAL_STORAGE"
      ]
    },
    "plugins": [
      "expo-router",
      "expo-splash-screen",
      "react-native-google-mobile-ads",
      "expo-camera",
      "expo-image-picker",
      "expo-media-library",
      "expo-notifications",
      "expo-updates"
    ],
    "experiments": {
      "typedRoutes": true
    },
    "extra": {
      "router": {
        "origin": false
      },
      "eas": {
        "projectId": "50463cdd-2009-410d-ae1e-f39adb5968d3"
      }
    },
    "runtimeVersion": "1.0.0",
    "updates": {
      "enabled": true,
      "fallbackToCacheTimeout": 0
    },
    "owner": "ozkanerbatu"
  }
}

Theories

  1. What could be causing the "spawn pod ENOENT" error for iOS builds when CocoaPods is correctly installed on my system (1.16.2)?
  2. Why is EAS Build unable to locate the gradlew file in the Android directory which clearly exists?
  3. Is there a version mismatch issue? I'm using EAS CLI 15.0.15 but my eas.json specifies ">= 7.3.0".
  4. Are there specific configurations needed in eas.json for a "bare" workflow project?
  5. Could this be related to a permissions issue or file structure problem that only manifests during the build upload?

Any help would be greatly appreciated as I've been stuck on this for a while. Thanks!


Solution

  • Solved: EAS Build Fails with "spawn pod ENOENT" and "No such file or directory" Errors I found the solution to the EAS build errors mentioned in the post. There were two key issues causing the build to fail: Solution Steps:

    First, I modified the eas.json file by setting commitRequired to true. This ensures all changes are committed before building. More importantly, I renamed several folders in my project structure that had problematic names. Folders named like app or auth can cause issues during the build process on iOS.

    After making these changes, the build completed successfully without the "spawn pod ENOENT" or "No such file or directory" errors. Hope this helps anyone facing similar issues!