expo: `expo run:android` Execution failed for task ':expo:compileDebugKotlin'.

Summary

I am trying to run expo run:android but it is throwing an error:

Task :expo:compileDebugKotlin FAILED e: Incompatible classes were found in dependencies. Remove them from the classpath or use ‘-Xskip-metadata-version-check’ to suppress errors e: /Users/fredrik/.gradle/caches/transforms-3/237076f67658440e344a90648c21f016/transformed/jetified-kotlin-stdlib-common-1.6.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.1. etc…

It’s basically the same as #15989 but I am using expo-file-system@13.1.4.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

44

Environment

System:
  OS: macOS 12.1
  Shell: 5.8 - /bin/zsh
Binaries:
  Node: 16.14.0 - /usr/local/bin/node
  Yarn: 1.22.18 - ~/Documents/code/dogs-app/node_modules/.bin/yarn
  npm: 8.5.5 - /usr/local/bin/npm
Managers:
  CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
IDEs:
  Android Studio: Bumblebee 2021.1.1 Patch 2 Bumblebee 2021.1.1 Patch 2
  Xcode: 13.3/13E113 - /usr/bin/xcodebuild
npmPackages:
  expo: ^44.0.0 => 44.0.6
  react: 17.0.1 => 17.0.1
  react-dom: 17.0.1 => 17.0.1
  react-native: 0.64.3 => 0.64.3
  react-native-web: 0.17.1 => 0.17.1
npmGlobalPackages:
  eas-cli: 0.48.2
  expo-cli: 5.3.0
Expo Workflow: bare

Reproducible demo

No demo should be required for this.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 16 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Try this fix

If I manually add this to build.gradle it works.

buildscript {
    ext {
        kotlinVersion = "1.6.0"
   }
}

Then I needed to follow this step as well: https://stackoverflow.com/a/58602329/5191800

You can also use expo-build-properties package and set the kotlinVersion in app.json which is a far simpler solution!

https://docs.expo.dev/versions/latest/sdk/build-properties/

Try this fix

You are a f god. Thanks!

Try this fix

I was stucked in the same issue and this worked for me

Try this fix 🙏🏼 thank you!

Try this fix

Saved my day as well, thanks a lot! I understand the function, but can you explain why allprojects.configurations.all.resolutionStrategy.force is even required at all? What is this exactly doing for the build?

Try this fix

you’re the best I love

Try this fix

I love you. Thanks

Try this fix

You saved my day ! Thanks