Managed - EAS build failed for both iOS and Android

I suspect I haven’t read the docs closely enough. I haven’t touched eas.json aside from what was auto-generated. But, I don’t need to build using EAS right now, so I think my main goal here is to post my errors just in case it’s useful to the Expo team. If anything obvious stands out, please let me know!

$ eas --version
eas-cli/0.14.1 linux-x64 node-v12.18.3

For Android, error at Run gradlew:

Task :app:bundleReleaseJsAndAssets FAILED

             Welcome to React Native!

            Learn once, write anywhere

Error: The resource /build/workingdir/build/index.js was not found.

at /build/workingdir/build/node_modules/metro/src/IncrementalBundler.js:157:26

at gotStat (fs.js:1864:21)

[stderr] error The resource /build/workingdir/build/index.js was not found. Run CLI with --verbose flag for more details.

at callback (/build/workingdir/build/node_modules/graceful-fs/polyfills.js:299:20)

at FSReqCallback.oncomplete (fs.js:183:21)

Task :expo-application:compileReleaseLibraryResources

Task :expo-constants:compileReleaseLibraryResources

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.

Use ‘–warning-mode all’ to show the individual deprecation warnings.

See Command-Line Interface

189 actionable tasks: 189 executed

[stderr] FAILURE: Build failed with an exception.

[stderr] * What went wrong:

[stderr] Execution failed for task ‘:app:bundleReleaseJsAndAssets’.

[stderr] > Process ‘command ‘node’’ finished with non-zero exit value 1

[stderr] * Try:

[stderr] 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.

[stderr] * Get more help at https://help.gradle.org

[stderr] BUILD FAILED in 1m 0s

Error: Gradle build failed with unknown error. Please see logs for the “Run gradlew” phase.

I searched and did not see people talking about graceful-fs/polyfills.js

For iOS, error at fastlane:

The following build commands failed:
PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/expo/Library/Developer/Xcode/DerivedData/PinballMap-gggmwdotbdtfqxahrpnwubjwlnpw/Build/Intermediates.noindex/ArchiveIntermediates/PinballMap/IntermediateBuildFilesPath/PinballMap.build/Release-iphoneos/PinballMap.build/Script-00DD1BFF1BD5951E006B06BC.sh

hi there! your js bundle is failing to build. maybe your app depends on some environment variable that isn’t available. you can view the full xcode build logs at the bottom of the build details page after it fails. if you share a link to the build page we can take a look

i think based off the error on android you’ve encountered a bit of a quirk in managed apps, where you may be using a different “main” in your app.json - you can create index.js that just imports your App.js and calls registerRootComponent(App) to work around it for now

Thanks! My main in package.json is index.js, though I don’t have main specified at all in app.json (I’ll look into that!).

Looking at the xcode log, it is complaining about index.js, as well (among other things). So perhaps that is the key.

Side comment about EAS: I don’t love that I have to commit everything before building. And that’s because my app.json contains sensitive keys which I never commit. For expo build, I just paste in those keys, save, and build. But then I remove them before I ever do commits. Obviously with EAS I can revert the commit, but that’s not my fave.

you shouldn’t need to specify anything in app.json. so you have “main”: “index.js” in your package.json and then you have an index.js file in the root of your project?

Side comment about EAS: I don’t love that I have to commit everything before building. And that’s because my app.json contains sensitive keys which I never commit. For expo build, I just paste in those keys, save, and build. But then I remove them before I ever do commits. Obviously with EAS I can revert the commit, but that’s not my fave.

we may end up changing our implementation to support building without committing your changes, but for your specific use case you should use secrets instead. if you want to read secrets from environment variables in your app config, move to using app.config.js. this way you don’t need to commit any of your secrets to source control and also you don’t have to manually put the values in and then remove when building.

I have "main": "./app/index.js" in package.json and then the index in that path. That’s where we are registering the root component. We don’t use an App.js file (which is probably the issue). This all feels too minor to use up your time with, though - I will check with our main dev (I’m the designer/front end person, and I just happen to usually make the builds!).

Err, good point about secrets :smiley: Thanks!