Build on EAS Server works, but not with --local

In your post, please share:

  • Whether you are bare or managed workflow - managed
  • Your eas-cli version - eas-cli/3.16.0 linux-x64 node-v18.16.1

If I run this command:
npx eas build --platform android
everything works fine. My manager asked me to find a find to build locally, so according to the documentation here: Run builds on your own infrastructure - Expo Documentation i should just be able to run
npx eas build --platform android --local
Unfortunately, this results in the following error stacktrace:

[RUN_GRADLEW] > Task :expo-modules-core:configureCMakeRelWithDebInfo[arm64-v8a] FAILED
[RUN_GRADLEW] > Task :app:mergeExtDexRelease
[RUN_GRADLEW] > Task :expo-modules-core:compileReleaseKotlin
[RUN_GRADLEW] w: Argument -Xopt-in is deprecated. Please use -opt-in instead
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/permissions/PermissionsService.kt:157:30 'getPackageInfo(String, Int): PackageInfo!' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/core/utilities/EmulatorUtilities.kt:30:13 'SERIAL: String!' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/Promise.kt:68:18 This declaration overrides deprecated member but not marked as deprecated itself. This deprecation won't be inherited in future releases. Please add @Deprecated annotation or suppress. See https://youtrack.jetbrains.com/issue/KT-47902 for details
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/activityresult/ActivityResultsManager.kt:52:24 Parameter 'activity' is never used
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/activityresult/AppContextActivityResultRegistry.kt:119:51 'getParcelableExtra(String!): T?' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/activityresult/AppContextActivityResultRegistry.kt:180:26 'getParcelable(String?): T?' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/activityresult/AppContextActivityResultRegistry.kt:271:83 'getParcelable(String?): T?' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/activityresult/DataPersistor.kt:67:20 'getSerializable(String?): Serializable?' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/activityresult/DataPersistor.kt:85:26 'getSerializable(String?): Serializable?' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/events/KModuleEventEmitterWrapper.kt:90:7 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/jni/JavaScriptObject.kt:59:33 Parameter 'null' is never used
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/jni/JavaScriptObject.kt:100:5 Parameter 'null' is never used
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/modules/Module.kt:43:7 'coroutineScope: CoroutineScope' is deprecated. Use a scope from the AppContext
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/types/Either.kt:24:11 Parameter 'type' is never used
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/types/Either.kt:27:11 Parameter 'type' is never used
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/types/Either.kt:44:11 Parameter 'type' is never used
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/types/Either.kt:59:11 Parameter 'type' is never used
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/types/JSTypeConverterHelper.kt:44:17 'get(String!): Any?' is deprecated. Deprecated in Java
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/views/ViewManagerDefinitionBuilder.kt:125:30 'ViewGroupDefinitionLegacyBuilder' is deprecated. Use `ViewGroupDefinitionBuilder` instead.
[RUN_GRADLEW] w: file:///tmp/rstuermer/eas-build-local-nodejs/67b90902-3064-45f1-b8c4-4a406a78048b/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/views/ViewManagerDefinitionBuilder.kt:128:38 'ViewGroupDefinitionLegacyBuilder' is deprecated. Use `ViewGroupDefinitionBuilder` instead.
[RUN_GRADLEW] FAILURE: Build completed with 2 failures.
[RUN_GRADLEW] 1: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':expo-modules-core:configureCMakeRelWithDebInfo[arm64-v8a]'.
[RUN_GRADLEW] >
[RUN_GRADLEW] Picked up JAVA_TOOL_OPTIONS: -Dhttps.proxyHost=proxy.abm-local.de -Dhttps.proxyPort=3128 -Dhttp.nonProxyHosts='localhost|127.0.0.1|192.168.30.*|[::1]'
[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] ==============================================================================
[RUN_GRADLEW] 2: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] java.lang.StackOverflowError (no error message)
[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] ==============================================================================
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 2m 35s
[RUN_GRADLEW] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[RUN_GRADLEW] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[RUN_GRADLEW] See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
[RUN_GRADLEW] Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
[RUN_GRADLEW] Please consult deprecation warnings for more details.
[RUN_GRADLEW] 141 actionable tasks: 141 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.
npx exited with non-zero code: 1
    Error: build command failed.

Similar issues i have found on the internet suggested to delete android, iOS, node_modules Folder and package-lock.json (and let them be newly generated).
I did so, but without any effect.
The recommended Flags “–stacktrace” etc. don’t seem to be used, even with the --output=stacktrace Flag in the eas build command.

I am quite confused by this error as I don’t understand what is causing it. It doesn’t seem to be any code I have written as I can reproduce it with a new project. I’m guessing it is something that clashes with the environment, as the build works perfectly fine on the eas build server. I’d be very thankful for any help.
I assume it must be some environment configuration that is causing it.
I have the following questions now:

  1. Where can i find the “Run gradlew” logs for more information?
  2. How can i solve this problem?
  3. Is there a list of environment configurations that i can check?

I also posted this question as a github issue, but since i havent gotten an answer in a while, i hoped someone here could help me.