Issue building locally with Expo EAS
Got the error described here: https://github.com/IjzerenHein/react-native-shared-element/issues/127
ijzerenhein/sharedelement/RNSharedElementDrawable.java:314: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types;
[RUN_GRADLEW] drawable.setBorderColor(borderColorRGB); // Use int instead of float
[RUN_GRADLEW] ^
[RUN_GRADLEW] required: int,Integer
[RUN_GRADLEW] found: int
[RUN_GRADLEW] reason: actual and formal argument lists differ in length
Fixed with patch (Attached, along with raw files).
Full stack:
[RUN_GRADLEW] > Task :react-native-shared-element:compileDebugJavaWithJavac FAILED
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:51: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal
[RUN_GRADLEW] private ReactViewBackgroundDrawable mReactViewBackgroundDrawableCache = null;
[RUN_GRADLEW] ^
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:299: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal
[RUN_GRADLEW] ReactViewBackgroundDrawable drawable = mReactViewBackgroundDrawableCache;
[RUN_GRADLEW] ^
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:301: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal
[RUN_GRADLEW] drawable = new ReactViewBackgroundDrawable(mContent.view.getContext());
[RUN_GRADLEW] ^
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:301: warning: [removal] ReactViewBackgroundDrawable(Context) in ReactViewBackgroundDrawable has been deprecated and marked for removal
[RUN_GRADLEW] drawable = new ReactViewBackgroundDrawable(mContent.view.getContext());
[RUN_GRADLEW] ^
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:314: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types;
[RUN_GRADLEW] drawable.setBorderColor(borderColorRGB); // Use int instead of float
[RUN_GRADLEW] ^
[RUN_GRADLEW] required: int,Integer
[RUN_GRADLEW] found: int
[RUN_GRADLEW] reason: actual and formal argument lists differ in length
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:317: warning: [removal] setRadius(float) in CSSBackgroundDrawable has been deprecated and marked for removal
[RUN_GRADLEW] drawable.setRadius(style.borderTopLeftRadius);
[RUN_GRADLEW] ^
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:318: warning: [removal] setRadius(float) in CSSBackgroundDrawable has been deprecated and marked for removal
[RUN_GRADLEW] drawable.setRadius(style.borderTopRightRadius);
[RUN_GRADLEW] ^
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:319: warning: [removal] setRadius(float) in CSSBackgroundDrawable has been deprecated and marked for removal
[RUN_GRADLEW] drawable.setRadius(style.borderBottomRightRadius);
[RUN_GRADLEW] ^
[RUN_GRADLEW] /private/var/folders/tr/mkgghk691s9726ht9s9z4rtm0000gn/T/eas-build-local-nodejs/1dbc7231-19a7-4ed8-89e8-01afd6d899cc/build/frontend/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:320: warning: [removal] setRadius(float) in CSSBackgroundDrawable has been deprecated and marked for removal
[RUN_GRADLEW] drawable.setRadius(style.borderBottomLeftRadius);
[RUN_GRADLEW] ^
[RUN_GRADLEW] Note: Some input files use or override a deprecated API.
[RUN_GRADLEW] Note: Recompile with -Xlint:deprecation for details.
[RUN_GRADLEW] 1 error
[RUN_GRADLEW] 8 warnings
Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).
Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.
Happens in all repos
how to apply this patch ?
@mimo-10 Just follow these steps:
-
[ ] Download the Patch
- Extract if inside a
.zipfile.
- Extract if inside a
-
[ ] Navigate to the Repository
-
cd /path/to/your/project -
cd node_modules/react-native-shared-element
-
-
[ ] Apply the Patch
-
git apply /path/to/react-native-shared-element+0.8.9.patch - Verify with
git diff
-
-
[ ] Rebuild the Project
-
rm -rf node_modules -
yarn install(ornpm install) -
cd android && ./gradlew clean && cd .. -
yarn react-native run-android
-
-
[ ] Persist with
patch-package(Optional)-
npm install patch-package postinstall-postinstall -
npx patch-package react-native-shared-element
-
@mimo-10 @oscarguinane @gnano222, hi i'm on expo 53, and i'm curious whether this patch works with expo new arch bridgeless mode
I don't know about the sdk 53, for for the new arch, it does how, but I Don't recommend it, it is not stable at all, wait to reanimated maybe they will release it with the newer versions of v4
this patch sorted out the error i was seeing during compilation but my whole app was unstable, using sdk 53.
I ended up downgrading to sdk 52 and using react native reanimated... even that's finicky but it seems more future proof