EAS Build / expo managed workflow FAILED on Run gradlew

These are the logs from my Run gradlew step. I have tried expo versions “41.0.0”, “42.0.0” and “43.0.0”, along with expo-cli versions “5.1.2” and “5.1.3” and finally eas-cli versions “0.46.0” and “0.47.0”. This build actually ran fine 2 weeks ago, and running the same build today throws this error.

> Task :expo:compileReleaseKotlin
w: /home/expo/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (134, 38): Unchecked cast: Any! to T
w: /home/expo/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (148, 45): Unchecked cast: Any! to T
w: /home/expo/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (15, 37): 'UIImplementationProvider' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (42, 47): 'UIImplementationProvider' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (100, 34): Unchecked cast: Any! to T
> Task :expo:javaPreCompileRelease
> Task :expo:compileReleaseJavaWithJavac FAILED
[stderr] /home/expo/workingdir/build/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:6: error: package expo.modules.kotlin.modules does not exist
[stderr] import expo.modules.kotlin.modules.Module;
[stderr]                                   ^
[stderr] /home/expo/workingdir/build/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:7: error: package expo.modules.kotlin does not exist
[stderr] import expo.modules.kotlin.ModulesProvider;
[stderr]                           ^
[stderr] /home/expo/workingdir/build/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:9: error: cannot find symbol
[stderr] public class ExpoModulesPackageList implements ModulesProvider {
[stderr]                                                ^
[stderr]   symbol: class ModulesProvider
[stderr] /home/expo/workingdir/build/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:39: error: cannot find symbol
[stderr]   public List<Class<? extends Module>> getModulesList() {
[stderr]                               ^
[stderr]   symbol:   class Module
[stderr]   location: class expo.modules.ExpoModulesPackageList
[stderr] /home/expo/workingdir/build/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:29: error: cannot find symbol
[stderr]     static final List<Class<? extends Module>> modulesList = Arrays.<Class<? extends Module>>asList(
[stderr]                                       ^
[stderr]   symbol:   class Module
[stderr]   location: class expo.modules.ExpoModulesPackageList.LazyHolder
[stderr] /home/expo/workingdir/build/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:29: error: cannot find symbol
[stderr]     static final List<Class<? extends Module>> modulesList = Arrays.<Class<? extends Module>>asList(
[stderr]                                                                                      ^
[stderr]   symbol:   class Module
[stderr]   location: class expo.modules.ExpoModulesPackageList.LazyHolder
[stderr] /home/expo/workingdir/build/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:38: error: method does not override or implement a method from a supertype
[stderr]   @Override
[stderr]   ^
[stderr] 7 errors
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo:compileReleaseJavaWithJavac'.
[stderr] > Compilation failed; see the compiler error output for details.
[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.

It doesn’t seem to specify any particular package it’s having issues with other than the compiled kotlin code. Since nothing has changed my end, I expect there is a package hidden somewhere which has had an upgrade or something internal to EAS build.

Thanks for any insight

hi there! nothing has changed on our end that would cause this issue. is it possible that you aren’t using exactly the same code? are you building from the exact commit? you can also follow this guide for more help: Troubleshooting build errors and crashes - Expo Documentation

Hi there, thankyou for your reply. The same logs occur if I run the exact same commit which passed 2 weeks ago with the eas-cli build --platform android command.

I can’t think of what other useful information I could provide you, the previously passing builds all show the same deprecated warnings but don’t have the errors shown in the :expo:compileReleaseJavaWithJavac task.

See if this part of the docs that Brent pointed to help at all:

If you are working on a managed app and the build error is a native error rather than a JavaScript error, this is likely due to a config plugin or a dependency in your project. Keep an eye out in the logs for any new packages that you’ve added since your previous successful build. Run expo doctor to determine that the versions of Expo SDK dependencies in your project are compatible with your Expo SDK version.

Thanks for your reply, I haven’t added any new dependencies since my previous successful builds but potentially due to using carets and tildes in the package.json, a newer version of a dependency may be being installed compared to the build 2 weeks ago. But I have run expo doctor to which I get a “Didn’t find any issues with the project” response

As a test, can you create a new app, copy your dependencies to the new app’s package.json and install them. Then try to build it.

If it works, then maybe try removing your yarn/npm lock file and node_modules and reinstalling them.

If the new app does not build, try figuring out whick package/s are causing the problem by e.g. removing half at a time to see if the build still fails. (i.e. a binary/bisection search).

Otherwise go through the debugging docs and let us know what you tried and what the outcomes were so we have some idea of what is happening.

Are you trying this on a mac m1? I had to change my ARCH for node. (easy with nvm)

$ nvm uninstall 16
$ arch -x86_64 zsh 
$ nvm install 16
$ nvm alias default 16

nvm info: