react native expo - Execution failed for task ':expo-updates:compileReleaseKotlin'

In order to add OTA updates functionality, I installed expo-updates package and before that I configured expo-modules@latest in my react native bare project. Everything worked fine, build successfully, but when I execute the command eas build -p android --profile preview, it crashes/build-fails after 6 mins due to the following error:

[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-updates:compileReleaseKotlin'.
[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr]    > Compilation error. See log for more details
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] java.lang.StackOverflowError (no error message)
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 4m 53s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

I searched for hours related to this issue and found something similar here Task :expo-updates:compileDebugKotlin FAILED React-Native 70 bare project · Issue #19259 · expo/expo · GitHub, applied the changes, and it is still throwing the same build everytime… Everything works in development though, no crashes there…

My env:

{
  ...,
  "dependencies": {
    "react": "18.1.0",
    "react-native": "0.70.0",
    "expo": "^46.0.0",
    "expo-updates": "~0.14.6",
  },
  ...
}

I am not able to create a build due to this error, if someone could help, I would really appreciate it!

I’m also seeing the same error with nearly the same dependencies.

“expo”: “^46.0.16”,
“react”: “18.0.0”,
“react-native”: “0.69.6”,
“expo-updates”: “~0.14.6”,

1 Like

UPDATE: I just removed expo-updates as my solution

1 Like

Same issue for me as well. Yesterday everything worked fine but today the build is failing. To my knowledge nothing has changed in my code since yesterday so hopefully this gets resolved soon.

Goat thank you :raised_hands:

Same issue here. Builds were fine yesterday, today they are failing with the same error. I removed expo-updates and updated react-native-screens, which seems to have fixed it.

I’ve got an official issue in the repo: expo-updates v0.14.6 bare workflow build issue · Issue #19867 · expo/expo · GitHub

1 Like

So for the time being I will be unable to use OTA updates? because expo-updates cannot be installed?

Hi. It looks like they’ve fixed the problem. Can you confirm?

A fix has been implemented for Expo SDK 43 through 47 (beta). We are monitoring Android build results.
Posted 14 minutes ago. Nov 04, 2022 - 14:53 PDT

1 Like

I made my react native application using expo, a to do list app, I finished it and continued to make the apk with “expo build: android” so far everything was correct, no errors and I was able to generate my apk. The problem is that when I want to start my app on my device it tells me that the app has stopped and closes instantly, I can only see the splash. I can’t find the error and I don’t know what it could be, I looked for more ways to make the apk but it ends up giving me the same error, my app appears perfectly in the emulator, the problem is when I use it on my device.

I fixed this problem im my project:

  • removing “expo-updates” from my package.json,
  • deleting node_modules folder,
  • running npm install and rebuild.

now is solved

I had the same version and got this error.

@noyes, did you try the instructions posted by Brent above?

i.e. if you have no android directory in your app, just rebuild. If you do have an android directory, then either regenerate it with npx expo prebuild --clean or manually make the changes to android/build.gradle.