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
- Change Kotlin version to 1.6.0 Ref: https://github.com/expo/expo/issues/16907#issuecomment-1088809249 — committed to upleveled/hotline-bling-codealong by karlhorky 2 years ago
- Change Kotlin version to 1.6.0 Ref: https://github.com/expo/expo/issues/16907#issuecomment-1088809249 — committed to upleveled/hotline-bling-codealong by karlhorky 2 years ago
Try this fix
If I manually add this to
build.gradle
it works.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 thekotlinVersion
inapp.json
which is a far simpler solution!https://docs.expo.dev/versions/latest/sdk/build-properties/
You are a f god. Thanks!
I was stucked in the same issue and this worked for me
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?
you’re the best I love
I love you. Thanks
You saved my day ! Thanks
Plugin for kotlin version: https://gist.github.com/Livijn/8be31941f09368e968718637fdcdbae3
Plugin for packagingOptions: https://github.com/software-mansion/react-native-reanimated/issues/2773#issuecomment-1013930054