[Gradle Build Error] Failed to compile with Kotlin 1.9.25 using react-native-reanimated on EAS Build (Expo Managed)
Description
𧨠Summary
I am using react-native-reanimated in an Expo Managed project and trying to build an AAB using EAS Build (:app:bundleRelease). The build fails at the Run gradlew phase due to incompatibility between Kotlin versions and native method calls in ReanimatedNativeHierarchyManager.
π¦ Environment
- Expo SDK: 50.0.7
- react-native-reanimated: 3.8.0
- expo-build-properties: 0.10.0
- expo-modules-core: 2.2.3
- Gradle: 8.10.2
- Android Gradle Plugin: 8.6.0
- Kotlin: 1.9.25 (forced in
eas.jsonandapp.json) - Workflow: Expo Managed
- Target: Android (.aab)
π Configuration Files
eas.json
{
"build": {
"android": {
"env": {
"KOTLIN_VERSION": "1.9.25"
}
}
}
}
app.json
{
"expo": {
"plugins": [
[
"expo-build-properties",
{
"android": {
"kotlinVersion": "1.9.25",
"composeCompilerVersion": "1.5.8"
}
}
]
]
}
}
β Error Output
> Task :react-native-reanimated:compileReleaseJavaWithJavac FAILED
error: no suitable method found for updateLayout(int,int,int,int,int,int)
super.updateLayout(parentTag, tag, x, y, width, height);
^
method NativeViewHierarchyManager.updateLayout(int,int,int,int,int) is not applicable
(actual and formal argument lists differ in length)
...
error: cannot find symbol
super.dismissPopupMenu();
^
symbol: method dismissPopupMenu()
error: cannot find symbol
return ((ReactViewBackgroundDrawable) background).getFullBorderRadius();
π What I've Tried
Downgrading react-native-reanimated to 3.7.1 β still fails
Ensuring all Kotlin versions are set to 1.9.25 in eas.json and app.json
Using latest expo-build-properties
Ensuring no native code was manually edited (Expo Managed workflow)
Read and followed: https://docs.expo.dev/build-reference/variables/#kotlin_version
βExpected
A successful AAB build with Kotlin 1.9.25, using react-native-reanimated on EAS Build.
π Questions
Is react-native-reanimated fully compatible with Kotlin 1.9.25 and Expo SDK 50.x?
Are there specific versions required for expo-modules-core or other native modules to avoid this?
Do I need to eject the project to resolve this, or is a patch/config workaround available?
π Additional Context
Iβm using EAS Build for the Play Store release and cannot modify build.gradle directly.
Any help, patch suggestions, or version alignment advice would be hugely appreciated π
### Steps to reproduce
1. Create a new Expo-managed app.
2. Install `react-native-reanimated` version 3.17.4.
3. Add the `expo-build-properties` plugin and set the Kotlin version and Compose Compiler version in `app.json`:
```json
{
"expo": {
"plugins": [
[
"expo-build-properties",
{
"android": {
"kotlinVersion": "1.9.25",
"composeCompilerVersion": "1.5.8"
}
}
]
]
}
}
4. Run eas build -p android --profile production.
5. The build fails at :react-native-reanimated:compileReleaseJavaWithJavac due to incompatible method signature updateLayout(...) and deprecated usage of ReactViewBackgroundDrawable.
### Snack or a link to a repository
Not applicable β the issue happens during EAS build, not at runtime. No code execution is involved.
### Reanimated version
3.6.1
### React Native version
0.76.0
### Platforms
Android
### JavaScript runtime
None
### Workflow
None
### Architecture
None
### Build type
_No response_
### Device
_No response_
### Host machine
None
### Device model
_No response_
### Acknowledgements
Yes
Hey! π
It looks like you've omitted a few important sections from the issue template.
Please complete Description section.
Hey! π
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
@JulianSET Please try upgrading Reanimated to a newer version according to the compatibility table.
Still got same error from my project,
> Configure project :
[ExpoRootProject] Using the following versions:
- buildTools: 35.0.0
- minSdk: 24
- compileSdk: 35
- targetSdk: 35
- ndk: 27.1.12297006
- kotlin: 2.0.21
- ksp: 2.0.21-1.0.28
> Configure project :expo
Using expo modules
- expo-constants (17.1.7)
- expo-modules-core (2.5.0)
- [?] expo-asset (11.1.7)
- [?] expo-blur (14.1.5)
- [?] expo-file-system (18.1.11)
- [?] expo-font (13.3.2)
- [?] expo-haptics (14.1.4)
- [?] expo-image (2.4.0)
- [?] expo-keep-awake (14.1.4)
- [?] expo-linking (7.1.7)
- [?] expo-splash-screen (0.30.10)
- [?] expo-system-ui (5.0.10)
- [?] expo-web-browser (14.2.0)
> Configure project :react-native-reanimated
Android gradle plugin: 8.8.2
Gradle: 8.13
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler output below.
C:\Users\~~~\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\ReactNativeUtils.java:6: error: cannot find symbol
import com.facebook.react.views.view.ReactViewBackgroundDrawable;
^
symbol: class ReactViewBackgroundDrawable
location: package com.facebook.react.views.view
C:\Users\~~~\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\layoutReanimation\ReanimatedNativeHierarchyManager.java:256: error: no suitable method found for updateLayout(int,int,int,int,int,int)
super.updateLayout(parentTag, tag, x, y, width, height);
^
method NativeViewHierarchyManager.updateLayout(int,int,int,int,int) is not applicable
(actual and formal argument lists differ in length)
method NativeViewHierarchyManager.updateLayout(int,int,int,int,int,int,YogaDirection) is not applicable
(actual and formal argument lists differ in length)
method NativeViewHierarchyManager.updateLayout(View,int,int,int,int) is not applicable
(actual and formal argument lists differ in length)
C:\Users\~~~\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\ReactNativeUtils.java:16: error: cannot find symbol
if (background instanceof ReactViewBackgroundDrawable) {
^
symbol: class ReactViewBackgroundDrawable
location: class ReactNativeUtils
C:\Users\~~~\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\ReactNativeUtils.java:17: error: cannot find symbol
return ((ReactViewBackgroundDrawable) background).getFullBorderRadius();
^
symbol: class ReactViewBackgroundDrawable
location: class ReactNativeUtils
C:\Users\~~~\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\ReanimatedModule.java:119: warning: [removal] onCatalystInstanceDestroy() in NativeModule has been deprecated and marked for removal
public void onCatalystInstanceDestroy() {
^
C:\Users\~~~\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\ReanimatedModule.java:120: warning: [removal] onCatalystInstanceDestroy() in NativeModule has been deprecated and marked for removal
super.onCatalystInstanceDestroy();
^
C:\Users\~~~\node_modules\react-native-reanimated\android\src\reactNativeVersionPatch\ReanimatedUIManager\latest\com\swmansion\reanimated\layoutReanimation\ReanimatedUIManager.java:103: error: cannot find symbol
super.replaceExistingNonRootView(oldTag, newTag);
^
symbol: method replaceExistingNonRootView(int,int)
C:\Users\~~~\node_modules\react-native-reanimated\android\src\reactNativeVersionPatch\ReanimatedUIManager\latest\com\swmansion\reanimated\layoutReanimation\ReanimatedUIManager.java:116: error: cannot find symbol
super.removeSubviewsFromContainerWithID(containerTag);
^
symbol: method removeSubviewsFromContainerWithID(int)
C:\Users\~~~\node_modules\react-native-reanimated\android\src\reactNativeVersionPatch\ReanimatedUIManager\latest\com\swmansion\reanimated\layoutReanimation\ReanimatedUIManager.java:167: error: cannot find symbol
super.measureLayoutRelativeToParent(tag, errorCallback, successCallback);
^
symbol: method measureLayoutRelativeToParent(int,Callback,Callback)
C:\Users\~~~\node_modules\react-native-reanimated\android\src\reactNativeVersionPatch\ReanimatedUIManager\latest\com\swmansion\reanimated\layoutReanimation\ReanimatedUIManager.java:227: error: cannot find symbol
super.showPopupMenu(reactTag, items, error, success);
^
symbol: method showPopupMenu(int,ReadableArray,Callback,Callback)
C:\Users\~~~\node_modules\react-native-reanimated\android\src\reactNativeVersionPatch\ReanimatedUIManager\latest\com\swmansion\reanimated\layoutReanimation\ReanimatedUIManager.java:232: error: cannot find symbol
super.dismissPopupMenu();
^
symbol: method dismissPopupMenu()
C:\Users\~~~\node_modules\react-native-reanimated\android\src\reactNativeVersionPatch\ReactFeatureFlagsWrapper\latest\com\swmansion\reanimated\ReactFeatureFlagsWrapper.java:8: error: cannot find symbol
ReactFeatureFlags.enableMountHooks = true;
^
symbol: variable enableMountHooks
location: class ReactFeatureFlags
...
Any resolution??