react-native-shared-element icon indicating copy to clipboard operation
react-native-shared-element copied to clipboard

Issue building locally with Expo EAS

Open oscarguinane opened this issue 10 months ago • 7 comments

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

react-native-shared-element+0.8.9.patch

Archive.zip

oscarguinane avatar Feb 18 '25 03:02 oscarguinane

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.

github-actions[bot] avatar Feb 18 '25 03:02 github-actions[bot]

Happens in all repos

oscarguinane avatar Feb 18 '25 03:02 oscarguinane

how to apply this patch ?

mimo-10 avatar Mar 09 '25 14:03 mimo-10

@mimo-10 Just follow these steps:

  • [ ] Download the Patch

    • Extract if inside a .zip file.
  • [ ] 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 (or npm 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

oscarguinane avatar Mar 09 '25 20:03 oscarguinane

@mimo-10 @oscarguinane @gnano222, hi i'm on expo 53, and i'm curious whether this patch works with expo new arch bridgeless mode

monyasau avatar Jun 08 '25 19:06 monyasau

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

mimo-10 avatar Jun 08 '25 19:06 mimo-10

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

gnano222 avatar Jun 08 '25 19:06 gnano222