expo: [eas] - Unable build application with EAS build

Summary

I have an error when I build an android app on EAS build. My build ID is a276ca34-3dae-45c1-a34e-c6133f30fced.

> Task :react-native-community_netinfo:checkReleaseManifest
> Task :react-native-community_masked-view:processReleaseManifest
> Task :react-native-gesture-handler:checkReleaseManifest
> Task :react-native-community_netinfo:processReleaseManifest
> Task :react-native-maps:checkReleaseManifest
> Task :app:bundleReleaseJsAndAssets FAILED
                 Welcome to React Native!
                Learn once, write anywhere
Error: The resource `/build/workingdir/build/apps/xxxxxxxxxx/index.js` was not found.
    at /build/workingdir/build/node_modules/metro/src/IncrementalBundler.js:157:26
    at gotStat (fs.js:1864:21)
    at callback (/build/workingdir/build/node_modules/graceful-fs/polyfills.js:299:20)
    at FSReqCallback.oncomplete (fs.js:183:21)
> Task :react-native-gesture-handler:processReleaseManifest
> Task :react-native-maps:processReleaseManifest

TL/DR: Other issues when I migrate the project to EAS build

I trying to migrate the current project from SDKv40 to SDKv41 and use EAS build. Because My project is in a mono repo so it has a lot of problems when I build the project.

  1. I have an issue with expo upgrade when ran it under apps/foo. Related to a bug of yarn, https://github.com/yarnpkg/yarn/issues/7807, so I have to downgrade yarn to version 1.18.0 with yarn policies set-version 1.18.0 to fix the issue.

  2. My project uses some private packages hosting on Github Package Registry. So, I have to authenticate with packages. Put .npmrc in the project root doesn’t work. I have to ready instruction to find the way is adding an script eas-build-pre-install into my package.json for update ~/.npmrc. (The guide should help me do it faster).

{
    "eas-build-pre-install": "echo \"//npm.pkg.github.com/:_authToken=${NPM_TOKEN}\" >> ~/.npmrc"
}
  1. My project in the workspace. Yeah, again. EAS complains about modules not found for expo-constant,… I checked the symlinks list at bare-expo but It not enough to resolve the issue. Finally, the list is below; a lot of modules have to symlinks:
{
  "expo-yarn-workspaces": {
    "symlinks": [
      "@unimodules/core",
      "@unimodules/react-native-adapter",
      "expo-camera",
      "expo-constants",
      "expo-splash-screen",
      "expo-structured-headers",
      "expo-updates",
      "unimodules-app-loader",
      "unimodules-barcode-scanner-interface",
      "unimodules-camera-interface",
      "unimodules-constants-interface",
      "unimodules-face-detector-interface",
      "unimodules-file-system-interface",
      "unimodules-font-interface",
      "unimodules-image-loader-interface",
      "unimodules-permissions-interface",
      "unimodules-sensors-interface",
      "unimodules-task-manager-interface"
    ]
  }
}

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

41.0.0

Environment

EAS BUILD

Reproducible demo or steps to reproduce from a blank project

none,

please DM me to get access my repo

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (22 by maintainers)

Most upvoted comments

Yeah, the first success build 7edb0b49-f66d-4ace-881f-f3fd1d271386

Just added a new secret. ENTRY_FILE. 😃))

Screen Shot 2021-05-07 at 05 22 52

we’re investigating a good fix for the index.js issue that you encountered. i’ll also update the documentation to clarify that support for monorepos with managed apps on eas build (wow that’s a lot of words) is still a bit rough

I have a question about symlinks list. Which modules I should symlinks? How can I find them without having to try each module one by one?

our new autolinking implementation won’t require this for expo modules: https://github.com/expo/expo/pull/11593

we need to symlink some packages because in podfile and gradle files some package contents are referred to by relative path, eg: https://github.com/expo/expo/blob/70b640021ae9f7c5df7eddddfe7a0b855548a3ee/templates/expo-template-bare-typescript/ios/Podfile#L1-L3

if you had a normal “bare” project then you might potentially change these paths to point to your monorepo root node_modules rather than symlinking to the project node_modules (although i still prefer symlinking), but these files don’t exist until prebuild runs for managed apps

i found the problem - in app.config.json you still have “sdkVersion”: “40.0.0”

you can actually just remove this field entirely and we will determine it based on your “expo” package version.

the result of the sdk version being wrong here is that we install the inappropriate versions of various packages, because we base that entirely off of the sdk version. we ended up installing react-native-unimodules 0.12.0 instead of 0.13.2, and the former brought with it expo-permissions@10.0.0

@giautm - i don’t think it’s a bug on our side, no. you can try to reproduce this issue by doing a fresh clone of your repo, running yarn, and then running expo prebuild in your project directory. i unfortunately can’t do that exact thing because i don’t have access to your private npm packages

it looks like your dependencies are incorrect for sdk 41:

you should have expo-permissions@12.0.1 but your project has expo-permissions@10.0.0

i suspect other deps are also out of date

can you share the project w/ me on github?

are you changing the bundle id dynamically in app.config.js or something?

Just update: I pick the wrong certificate distribution type (I picked ALL instead of iOS). Re-generate new certificates fixed the issue.

Thanks @brentvatne, ❤️

can you try running the build locally with the instructions from https://docs.expo.io/build-reference/local-builds/ and see if that helps to understand the source of the issue?