Skip to content

React Native Shared Element is incompatible with expo@52 #127

Open

Description

@Lychas

I'm trying to build my android build and it seems that React Native Shared Element is incompatible and causes the build to fail.

> Task :react-native-shared-element:compileDebugJavaWithJavac FAILED
/home/expo/workingdir/build/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
  private ReactViewBackgroundDrawable mReactViewBackgroundDrawableCache = null;
          ^
/home/expo/workingdir/build/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
    ReactViewBackgroundDrawable drawable = mReactViewBackgroundDrawableCache;
    ^
/home/expo/workingdir/build/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
      drawable = new ReactViewBackgroundDrawable(mContent.view.getContext());
                     ^
/home/expo/workingdir/build/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
      drawable = new ReactViewBackgroundDrawable(mContent.view.getContext());
                 ^
/home/expo/workingdir/build/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;
      drawable.setBorderColor(i, borderColorRGB, borderColorAlpha);
              ^
  required: int,Integer
  found:    int,float,float
  reason: actual and formal argument lists differ in length
/home/expo/workingdir/build/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:317: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal
    drawable.setRadius(style.borderTopLeftRadius, 0);
            ^
/home/expo/workingdir/build/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:318: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal
    drawable.setRadius(style.borderTopRightRadius, 1);
            ^
/home/expo/workingdir/build/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:319: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal
    drawable.setRadius(style.borderBottomRightRadius, 2);
            ^
/home/expo/workingdir/build/node_modules/react-native-shared-element/android/src/main/java/com/ijzerenhein/sharedelement/RNSharedElementDrawable.java:320: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal
    drawable.setRadius(style.borderBottomLeftRadius, 3);
            ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
8 warnings

Activity

  1. github-actions commented on Jan 12, 2025

    @github-actions

    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.

  2. chandresh8187 commented on Jan 21, 2025

    @chandresh8187

    i am also facing same

  3. IjzerenHein commented on Jan 21, 2025

    @IjzerenHein
    Owner

    With introduction of the latest react-native version, some internals were changed which broke compatibility with react-native-shared-element. I've just published a pre-release (v0.9.0-rc0) as next to NPM which should fix the compatibility problem.

    You can install it using yarn add react-native-shared-element@next (or whichenever package manager you are using)

    Please let me know if that resolves the problem for you 🙏

  4. LegendProjects commented on Jan 22, 2025

    @LegendProjects

    With introduction of the latest react-native version, some internals were changed which broke compatibility with react-native-shared-element. I've just published a pre-release (v0.9.0-rc0) as next to NPM which should fix the compatibility problem.

    You can install it using yarn add react-native-shared-element@next (or whichenever package manager you are using)

    Please let me know if that resolves the problem for you 🙏

    You cannot use in expo sdk 52 SharedElements is not working at all doesn't do any animation

  5. IjzerenHein commented on Jan 23, 2025

    @IjzerenHein
    Owner

    With introduction of the latest react-native version, some internals were changed which broke compatibility with react-native-shared-element. I've just published a pre-release (v0.9.0-rc0) as next to NPM which should fix the compatibility problem.
    You can install it using yarn add react-native-shared-element@next (or whichenever package manager you are using)
    Please let me know if that resolves the problem for you 🙏

    You cannot use in expo sdk 52 SharedElements is not working at all doesn't do any animation

    Are you using a dev-client or Expo Go?
    Cause I have a Expo 52 example application (see example folder), and it's definitely working in there

  6. LegendProjects commented on Jan 23, 2025

    @LegendProjects

    With introduction of the latest react-native version, some internals were changed which broke compatibility with react-native-shared-element. I've just published a pre-release (v0.9.0-rc0) as next to NPM which should fix the compatibility problem.
    You can install it using yarn add react-native-shared-element@next (or whichenever package manager you are using)
    Please let me know if that resolves the problem for you 🙏

    You cannot use in expo sdk 52 SharedElements is not working at all doesn't do any animation

    Are you using a dev-client or Expo Go? Cause I have a Expo 52 example application (see example folder), and it's definitely working in there

    Expo Go I tried before

    In Expo Go the new arch is enabled even if in app.json is false, so probably will not work as i recently discovered, but in dev-client probably will work, I will try with the example folder

  7. IjzerenHein commented on Jan 23, 2025

    @IjzerenHein
    Owner

    Expo Go no longer contains react-native-shared-element, it was removed a while ago. See this comment in the README https://github.com/IjzerenHein/react-native-shared-element?tab=readme-ov-file#installation

    You'll need to create a development-build
    https://docs.expo.dev/develop/development-builds/create-a-build/

  8. pfcodes commented on Feb 6, 2025

    @pfcodes
    Build failed: The "Run fastlane" step failed because of an error in the Xcode build process. We automatically detected following errors in your Xcode build logs:
    - no member named 'topLeft' in 'RCTCornerRadii'
    - no member named 'topRight' in 'RCTCornerRadii'
    - no member named 'bottomLeft' in 'RCTCornerRadii'
    - no member named 'bottomRight' in 'RCTCornerRadii'
    - no member named 'topLeft' in 'RCTCornerRadii'
    - no member named 'topLeft' in 'RCTCornerRadii'
    - no member named 'topLeft' in 'RCTCornerRadii'
    - no member named 'topRight' in 'RCTCornerRadii'
    - no member named 'topRight' in 'RCTCornerRadii'
    - no member named 'topRight' in 'RCTCornerRadii'
    - no member named 'bottomLeft' in 'RCTCornerRadii'
    - no member named 'bottomLeft' in 'RCTCornerRadii'
    - no member named 'bottomLeft' in 'RCTCornerRadii'
    - no member named 'bottomRight' in 'RCTCornerRadii'
    - no member named 'bottomRight' in 'RCTCornerRadii'
    - no member named 'bottomRight' in 'RCTCornerRadii'
    Refer to "Xcode Logs" below for additional, more detailed logs.
    

    I get this build error after upgrading to expo 52 development build

  9. oscarguinane commented on Feb 18, 2025

    @oscarguinane

    Temporary fix: #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions