EAS build failing with error : Execution failed for task ':expo-modules-core:compileReleaseKotlin'

Hello,
we are having some errors building with EAS (since 3 days). Builds are failing on Android as well as iOS
the android build is failing with this error.

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-modules-core:compileReleaseKotlin'.
[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] * Get more help at https://help.gradle.org
  • We are on managed workflow
  • Expo version 46.0.0
  • react-native version: 0.69.5
  • eas-cli version: eas-cli/2.2.1 darwin-x64 node-v16.15.0

We tried to update react native version to 0.69.6 as per expo doctor warning

[stderr] [18:35:54] Some dependencies are incompatible with the installed expo package version:
[stderr] [18:35:54]  - react-native - expected version: 0.69.6 - actual version installed: 0.69.5
[stderr] [18:35:54] Your project may not work correctly until you install the correct versions of the packages.
[stderr] To install the correct versions of these packages, please run: expo doctor --fix-dependencies,
[stderr] or install individual packages by running expo install [package-name ...]

Bu this did not fix the build.

We tried older builds but unfortunately they failed as well.

Edit :

On the android build, “run gradlew” step. we are having this errors

[stderr]


e: /home/expo/workingdir/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/types/TypeConverterProvider.kt: (54, 16): Class 'kotlin.reflect.KClass' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.1.


1596[stderr]


The class is loaded from /home/expo/.gradle/caches/transforms-3/f9a6c4180d9d810f143b823eeeb39ba3/transformed/jetified-kotlin-stdlib-1.6.10.jar!/kotlin/reflect/KClass.class


1597[stderr]


e: /home/expo/workingdir/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/types/TypeConverterProvider.kt: (55, 14): Class 'kotlin.reflect.KType' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.1.

Thanks for the reply !

Here is our last build Build Details — 26eec9f7-60a8-40ab-93d2-5ba3488e02ab — mayo-by-hello-elton — Expo

We will try as well to follow the guide and do the build locally…

can you share the output of npm why expo-modules-core?

if you can share the repo with me on github (i’m brentvatne) i can help investigate

2 Likes

Thanks Brent !!
Here is the output of the command

expo-modules-core@0.6.5 peer
node_modules/expo-modules-core
  peer expo-modules-core@"^0.6.3" from @expo/match-media@0.3.0
  node_modules/@expo/match-media
    @expo/match-media@"^0.3.0" from the root project

expo-modules-core@0.11.7
node_modules/expo/node_modules/expo-modules-core
  expo-modules-core@"0.11.7" from expo@46.0.15
  node_modules/expo
    expo@"^46.0.0" from the root project
    peer expo@"*" from expo-application@4.2.2
    node_modules/expo-application
      expo-application@"~4.2.2" from the root project
      expo-application@"~4.2.2" from expo@46.0.15
      expo-application@"~4.2.0" from expo-notifications@0.16.1
      node_modules/expo-notifications
        expo-notifications@"~0.16.1" from the root project
    peer expo@"*" from expo-av@12.0.4
    node_modules/expo-av
      expo-av@"~12.0.4" from the root project
    peer expo@"*" from expo-camera@12.3.0
    node_modules/expo-camera
      expo-camera@"~12.3.0" from the root project
    peer expo@"*" from expo-constants@13.2.4
    node_modules/expo-constants
      expo-constants@"~13.2.4" from the root project
      expo-constants@"~13.2.4" from expo@46.0.15
      expo-constants@"~13.2.2" from expo-asset@8.6.1
      node_modules/expo-asset
        expo-asset@"~8.6.1" from the root project
        expo-asset@"~8.6.1" from expo@46.0.15
      expo-constants@"~13.2.0" from expo-linking@3.2.2
      node_modules/expo-linking
        expo-linking@"~3.2.2" from the root project
      expo-constants@"~13.2.0" from expo-notifications@0.16.1
      node_modules/expo-notifications
        expo-notifications@"~0.16.1" from the root project
    peer expo@"*" from expo-error-recovery@3.2.0
    node_modules/expo-error-recovery
      optional expo-error-recovery@"~3.2.0" from expo@46.0.15
    peer expo@"*" from expo-file-system@14.1.0
    node_modules/expo-file-system
      expo-file-system@"~14.1.0" from the root project
      expo-file-system@"~14.1.0" from expo@46.0.15
      expo-file-system@"~14.1.0" from expo-asset@8.6.1
      node_modules/expo-asset
        expo-asset@"~8.6.1" from the root project
        expo-asset@"~8.6.1" from expo@46.0.15
    peer expo@"*" from expo-font@10.2.1
    node_modules/expo-font
      expo-font@"~10.2.0" from the root project
      expo-font@"~10.2.1" from expo@46.0.15
    peer expo@"*" from expo-haptics@11.3.0
    node_modules/expo-haptics
      expo-haptics@"~11.3.0" from the root project
    peer expo@"*" from expo-keep-awake@10.2.0
    node_modules/expo-keep-awake
      expo-keep-awake@"~10.2.0" from expo@46.0.15
    peer expo@"*" from expo-localization@13.1.0
    node_modules/expo-localization
      expo-localization@"~13.1.0" from the root project
    peer expo@"*" from expo-notifications@0.16.1
    node_modules/expo-notifications
      expo-notifications@"~0.16.1" from the root project
    peer expo@"*" from expo-pwa@0.0.123
    node_modules/expo-pwa
      expo-pwa@"0.0.123" from @expo/webpack-config@0.17.2
      node_modules/@expo/webpack-config
        dev @expo/webpack-config@"^0.17.0" from the root project
    peer expo@"*" from expo-screen-orientation@4.3.0
    node_modules/expo-screen-orientation
      expo-screen-orientation@"~4.3.0" from the root project
      peer expo-screen-orientation@"^4.1.1" from @expo/match-media@0.3.0
      node_modules/@expo/match-media
        @expo/match-media@"^0.3.0" from the root project
    peer expo@"*" from expo-splash-screen@0.16.2
    node_modules/expo-splash-screen
      expo-splash-screen@"~0.16.2" from the root project
    peer expo@"*" from expo-updates@0.14.6
    node_modules/expo-updates
      expo-updates@"^0.14.5" from the root project
    peer expo@"*" from expo-updates-interface@0.7.0
    node_modules/expo-updates-interface
      expo-updates-interface@"~0.7.0" from expo-updates@0.14.6
      node_modules/expo-updates
        expo-updates@"^0.14.5" from the root project
    peer expo@"*" from expo-web-browser@11.0.0
    node_modules/expo-web-browser
      expo-web-browser@"~11.0.0" from the root project

this is the problem.

install @expo/match-media@0.4.0 and then also run npx expo install expo-screen-orientation.

i just published this version of match-media so that it doesn’t depend on an old version of expo-modules-core. after you install it, please run npm why expo-modules-core and npm why expo-screen-orientation and share output. go ahead and start a build again after installing that version.

1 Like

:heart:
I will try it right away !! thanks

1 Like

expo-modules-core@0.11.7
node_modules/expo/node_modules/expo-modules-core
  expo-modules-core@"0.11.7" from expo@46.0.15
  node_modules/expo
    expo@"^46.0.0" from the root project
    peer expo@"*" from @expo/match-media@0.4.0
    node_modules/@expo/match-media
      @expo/match-media@"^0.4.0" from the root project
    peer expo@"*" from expo-application@4.2.2
    node_modules/expo-application
      expo-application@"~4.2.2" from the root project
      expo-application@"~4.2.2" from expo@46.0.15
      expo-application@"~4.2.0" from expo-notifications@0.16.1
      node_modules/expo-notifications
        expo-notifications@"~0.16.1" from the root project
    peer expo@"*" from expo-av@12.0.4
    node_modules/expo-av
      expo-av@"~12.0.4" from the root project
    peer expo@"*" from expo-camera@12.3.0
    node_modules/expo-camera
      expo-camera@"~12.3.0" from the root project
    peer expo@"*" from expo-constants@13.2.4
    node_modules/expo-constants
      expo-constants@"~13.2.4" from the root project
      expo-constants@"~13.2.4" from expo@46.0.15
      expo-constants@"~13.2.2" from expo-asset@8.6.1
      node_modules/expo-asset
        expo-asset@"~8.6.1" from the root project
        expo-asset@"~8.6.1" from expo@46.0.15
      expo-constants@"~13.2.0" from expo-linking@3.2.2
      node_modules/expo-linking
        expo-linking@"~3.2.2" from the root project
      expo-constants@"~13.2.0" from expo-notifications@0.16.1
      node_modules/expo-notifications
        expo-notifications@"~0.16.1" from the root project
    peer expo@"*" from expo-error-recovery@3.2.0
    node_modules/expo-error-recovery
      optional expo-error-recovery@"~3.2.0" from expo@46.0.15
    peer expo@"*" from expo-file-system@14.1.0
    node_modules/expo-file-system
      expo-file-system@"~14.1.0" from the root project
      expo-file-system@"~14.1.0" from expo@46.0.15
      expo-file-system@"~14.1.0" from expo-asset@8.6.1
      node_modules/expo-asset
        expo-asset@"~8.6.1" from the root project
        expo-asset@"~8.6.1" from expo@46.0.15
    peer expo@"*" from expo-font@10.2.1
    node_modules/expo-font
      expo-font@"~10.2.0" from the root project
      expo-font@"~10.2.1" from expo@46.0.15
    peer expo@"*" from expo-haptics@11.3.0
    node_modules/expo-haptics
      expo-haptics@"~11.3.0" from the root project
    peer expo@"*" from expo-keep-awake@10.2.0
    node_modules/expo-keep-awake
      expo-keep-awake@"~10.2.0" from expo@46.0.15
    peer expo@"*" from expo-localization@13.1.0
    node_modules/expo-localization
      expo-localization@"~13.1.0" from the root project
    peer expo@"*" from expo-notifications@0.16.1
    node_modules/expo-notifications
      expo-notifications@"~0.16.1" from the root project
    peer expo@"*" from expo-pwa@0.0.123
    node_modules/expo-pwa
      expo-pwa@"0.0.123" from @expo/webpack-config@0.17.2
      node_modules/@expo/webpack-config
        dev @expo/webpack-config@"^0.17.0" from the root project
    peer expo@"*" from expo-screen-orientation@4.3.0
    node_modules/expo-screen-orientation
      expo-screen-orientation@"~4.3.0" from the root project
      peer expo-screen-orientation@"*" from @expo/match-media@0.4.0
      node_modules/@expo/match-media
        @expo/match-media@"^0.4.0" from the root project
    peer expo@"*" from expo-splash-screen@0.16.2
    node_modules/expo-splash-screen
      expo-splash-screen@"~0.16.2" from the root project
    peer expo@"*" from expo-updates@0.14.6
    node_modules/expo-updates
      expo-updates@"^0.14.5" from the root project
    peer expo@"*" from expo-updates-interface@0.7.0
    node_modules/expo-updates-interface
      expo-updates-interface@"~0.7.0" from expo-updates@0.14.6
      node_modules/expo-updates
        expo-updates@"^0.14.5" from the root project
    peer expo@"*" from expo-web-browser@11.0.0
    node_modules/expo-web-browser
      expo-web-browser@"~11.0.0" from the root project

expo-screen-orientation@4.3.0
node_modules/expo-screen-orientation
  expo-screen-orientation@"~4.3.0" from the root project
  peer expo-screen-orientation@"*" from @expo/match-media@0.4.0
  node_modules/@expo/match-media
    @expo/match-media@"^0.4.0" from the root project

after installing @expo/match-media@0.4.0 and then running npx expo install expo-screen-orientation.
The build yields other errors now

[stderr] FAILURE: Build failed with an exception.
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/node_modules/expo/android/build.gradle' line: 39
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':expo'.
[stderr] > Project with path ':expo-modules-core' could not be found in project ':expo'.
[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] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 2m

it looks like you are inside of a monorepo, is that right? you should be sure to follow the guidelines here: Working with Monorepos - Expo Documentation

Thanks! Actually this is not a monorepo. It is a single application.

The thing is, we already had a successful build the last week. We started having build errors this week (even when running builds on previous successful changes)

can you share me a link to a failing and succeeding build from the same git commit? that would be helpful for us to investigate if this is the case

1 Like

i had a look at the github repo you shared but i’m not sure i can help from that, it’d be more helpful to be able to access the real repo so i can see the history and try running a build locally from it

1 Like

Here is the successfull Android build

The failing build from the same commit

Please note that we did have some expo doctor warnings on both of these builds

Here is another build we did run just after fixing expo doctor issues

@brents we do have the repo in azure devops, unfortunately we don’t have it in github. I can send you an invite

We are recreating a new project with freshly installed dependencies, let’s see if this works

I have just invited you to a new github repo containing the full commit history :slight_smile:

Here is the sha1 of the las working commit e2ff9ed7d4c380f09da3e2b1de8cb84b79380234

1 Like

hey there, it looks like your builds are succeeding now. i also cloned the repo and build it successfully locally. what did you change on your end?

Yes ! We finally ended up creating a new project and reinstalled all the packages one by one.

However we did not find the module/modules that were causing the build issue.

Thank you very much @brents for your assistance that was very helpful!

2 Likes

very strange. i’ll have a look at the builds and try to see if i can find out what changed. thanks for the followup and i’m glad you were able to solve it

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.