Local Mac EAS Android build cannot process credentials

  • Managed workflow
  • Expo 47.0.13
  • React Native 0.70.5
  • EAS CLI 3.5.2
  • Node 16.13.0
  • Android SDK 12 (per RN docs)
  • Platform Mac

I recently noticed that I was approaching the monthly EAS build limits and wanted to avoid lengthy queue times, and realized that building locally was an option. I was able to get the iOS build working but have struggled with the Android process. I was able to fix my first few issues by updating the Android SDK to 12 (as per RN docs for RN 0.70). However, I now have an issue with failing to process a local credentials file. I would appreciate any insight, as I worry about running into hosted EAS Build limits. However, the project does build successfully in the EAS Build platform.

The crux of the matter seems to be an invalid reference to a file, and I have attached the build notes here.

Unable to process file: /var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/269803e6-c540-4691-9f80-b0b78b7c7ad9/build/credentials.json

Update: Just tested on Windows (via WSL) and was able to build a local APK using EAS Build, so the issue appears to be specific to building on Mac.

❯ eas build --platform android --profile preview --local --clear-cache
✔ Using remote Android credentials (Expo server)
✔ Using Keystore from configuration: Build Credentials QOGYttcPJt (default)
Node.js version in your eas.json does not match the Node.js currently installed in your system
ANDROID_NDK_HOME environment variable was not specified, continuing build without NDK
[SETUP_WORKINGDIR] Preparing workingdir /var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0
[START_BUILD] Starting build
  "job": {
    "type": "managed",
    "platform": "android",
    "projectRootDirectory": ".",
    "projectArchive": {
      "type": "PATH",
      "path": "/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-cli-nodejs/bb1461c0-0db6-4ac1-9eee-bed184b07300.tar.gz"
    },
    "builderEnvironment": {
      "node": "16.6.0",
      "env": {
        "APP_VARIANT": "preview"
      }
    },
    "cache": {
      "disabled": false,
      "customPaths": [],
      "cacheDefaultPaths": true,
      "clear": true
    },
    "updates": {
      "channel": "preview"
    },
    "buildType": "apk",
    "username": "kendallroth",
    "experimental": {},
    "mode": "build",
    "triggeredBy": "EAS_CLI"
  }
[READ_PACKAGE_JSON] Using package.json:
[READ_PACKAGE_JSON] {
  "dependencies": {
    "@hookform/resolvers": "^2.9.10",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/datetimepicker": "6.5.2",
    "@react-native-community/eslint-config": "^3.2.0",
    "@react-native-masked-view/masked-view": "0.2.8",
    "@react-navigation/material-bottom-tabs": "^6.2.12",
    "@react-navigation/native": "^6.1.3",
    "@react-navigation/native-stack": "^6.9.9",
    "@react-navigation/stack": "^6.3.12",
    "@reduxjs/toolkit": "^1.9.2",
    "country-flag-icons": "^1.5.5",
    "dayjs": "^1.11.7",
    "expo": "^47.0.13",
    "expo-application": "~5.0.1",
    "expo-clipboard": "~4.0.1",
    "expo-constants": "~14.0.2",
    "expo-device": "~5.0.0",
    "expo-linking": "~3.3.0",
    "expo-localization": "~14.0.0",
    "expo-sharing": "~11.0.1",
    "expo-splash-screen": "~0.17.5",
    "expo-status-bar": "~1.4.2",
    "expo-updates": "~0.15.6",
    "faker": "^5.5.3",
    "fast-sort": "^3.2.1",
    "i18next": "^21.8.3",
    "intl-pluralrules": "^1.3.1",
    "jest": "^26.6.3",
    "patch-package": "^6.5.1",
    "qs": "^6.11.0",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-hook-form": "^7.43.0",
    "react-i18next": "^11.16.9",
    "react-native": "0.70.5",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-get-random-values": "~1.8.0",
    "react-native-loading-spinner-overlay": "^2.0.0",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^14.0.1",
    "react-native-paper": "^5.1.4",
    "react-native-reanimated": "~2.12.0",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-svg": "13.4.0",
    "react-native-vector-icons": "^9.2.0",
    "react-native-web": "~0.18.7",
    "react-redux": "^7.2.6",
    "redux-persist": "^6.0.0",
    "uuid": "^8.3.2",
    "yup": "^0.32.11"
  },
  "devDependencies": {
    "@babel/core": "^7.20.12",
    "@babel/eslint-parser": "^7.19.1",
    "@expo/config": "^7.0.2",
    "@types/faker": "^5.5.9",
    "@types/jest": "^27.5.1",
    "@types/qs": "^6.9.7",
    "@types/react": "~18.0.24",
    "@types/react-native": "~0.70.6",
    "@types/react-native-loading-spinner-overlay": "^0.5.3",
    "@types/react-native-vector-icons": "^6.4.13",
    "@types/uuid": "^8.3.4",
    "@typescript-eslint/eslint-plugin": "^5.50.0",
    "babel-plugin-module-resolver": "^4.1.0",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "eslint": "^8.33.0",
    "eslint-import-resolver-typescript": "^3.5.3",
    "eslint-plugin-import": "^2.27.5",
    "husky": "^8.0.3",
    "jest-expo": "^47.0.1",
    "lint-staged": "^12.4.1",
    "prettier": "^2.8.3",
    "typescript": "^4.9.5"
  }
}
[INSTALL_DEPENDENCIES] Running "npm install" in the root dir of your repository
...ommitted...
[INSTALL_DEPENDENCIES] added 1926 packages, and audited 1927 packages in 14s
[READ_APP_CONFIG] Using app configuration:
[READ_APP_CONFIG] {
  "name": "My Days (preview)",
  "slug": "my-days",
  "version": "0.2.0",
  "runtimeVersion": {
    "policy": "sdkVersion"
  },
  "owner": "kendallroth",
  "orientation": "portrait",
  "platforms": ["android", "ios"],
  "entryPoint": "index.js",
  "primaryColor": "#00629E",
  "jsEngine": "hermes",
  "scheme": "my-days-preview",
  "icon": "./assets/icon_shadow.png",
  "splash": {
    "image": "./assets/splash.png",
    "resizeMode": "cover",
    "backgroundColor": "#00629E"
  },
  "assetBundlePatterns": ["**/*"],
  "android": {
    "adaptiveIcon": {
      "foregroundImage": "./assets/android_launcher_foreground.png",
      "backgroundColor": "#00629E"
    },
    "package": "ca.kendallroth.my_days.preview",
    "permissions": [],
    "versionCode": 3
  },
  "androidNavigationBar": {
    "barStyle": "light-content"
  },
  "extra": {
    "easBuildGitCommit": "09af85ddb722c61ed4e2e3f124878c1d7d2e2bfa",
    "eas": {
      "projectId": "0f596901-0769-4dcf-af51-73106137d331"
    }
  },
  "sdkVersion": "47.0.0",
  "currentFullName": "@kendallroth/my-days",
  "originalFullName": "@kendallroth/my-days"
}
[RUN_EXPO_DOCTOR] Running "expo doctor"
[RUN_EXPO_DOCTOR] - Finding all copies of expo-modules-autolinking
[RUN_EXPO_DOCTOR] - Finding all copies of @expo/config-plugins
[RUN_EXPO_DOCTOR] - Finding all copies of @expo/prebuild-config
[RUN_EXPO_DOCTOR] - Finding all copies of @unimodules/core
[RUN_EXPO_DOCTOR] - Finding all copies of @unimodules/react-native-adapter
[RUN_EXPO_DOCTOR] - Finding all copies of react-native-unimodules
[RUN_EXPO_DOCTOR] [13:39:33] 🎉 Didnt find any issues with the project!
[PREBUILD] › expo.entryPoint is not needed and has been removed.
[PREBUILD] - Creating native project directories (./ios and ./android) and updating .gitignore
[PREBUILD] ✔ Created native project | gitignore skipped
[PREBUILD] - Adding Metro bundler config
[PREBUILD] ✔ Added Metro config
[PREBUILD] - Updating your package.json scripts, dependencies, and main file
[PREBUILD] ✔ Updated package.json and added index.js entry point for iOS and Android
[PREBUILD] - Config syncing
[PREBUILD] Using node to generate images. This is much slower than using native packages.
[PREBUILD] › Optionally you can stop the process and try again after successfully running `npm install -g sharp-cli`.
[PREBUILD] - Config syncing
[PREBUILD] ✔ Config synced
[PREBUILD] Running "npm install" in the root dir of your repository
...ommitted...
[PREBUILD] up to date, audited 1927 packages in 3s
[PREPARE_CREDENTIALS] Writing secrets to the projects directory
[PREPARE_CREDENTIALS] Injecting signing config into build.gradle
[CONFIGURE_EXPO_UPDATES] Setting the update request headers in 'AndroidManifest.xml' to '{"expo-channel-name":"preview"}'
[RUN_GRADLEW] Running 'gradlew :app:assembleRelease' in /var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/android
[RUN_GRADLEW] > Task :react-native-gradle-plugin:compileKotlin
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (157, 32): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (163, 31): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (171, 36): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt: (114, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with root to point to your root project and reactNativeDir to point to the folder of the react-native NPM package
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Jav
a
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (27, 51): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (130, 12): 'ApplicationVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (131, 12): 'LibraryVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: /private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (251, 14): 'BaseVariant' is deprecated. Deprecated in Java
[RUN_GRADLEW] > Task :react-native-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :react-native-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :react-native-gradle-plugin:processResources
[RUN_GRADLEW] > Task :react-native-gradle-plugin:classes
[RUN_GRADLEW] > Task :react-native-gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Task :react-native-gradle-plugin:jar
[RUN_GRADLEW] FAILURE:
[RUN_GRADLEW] Build failed with an exception.
[RUN_GRADLEW] * Where:
[RUN_GRADLEW] Script '/private/var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/f96831e5-63a0-44d6-a249-bfd08787aba0/build/android/app/eas-build.gradle' line: 30
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred evaluating script.
[RUN_GRADLEW] > Unable to process file: /var/folders/g5/d3z2qf4s7n14lj5dlcv59xbm0000gn/T/eas-build-local-nodejs/269803e6-c540-4691-9f80-b0b78b7c7ad9/build/credentials.json
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 13s
[RUN_GRADLEW] 5 actionable tasks: 5 executed
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
    Error: npx exited with non-zero code: 1