Repository navigation
Open
Labels
Description
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
Reacted by Aya Sato and chandresh8187
Activity
github-actions commentedon Jan 12, 2025
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.
chandresh8187 commentedon Jan 21, 2025
i am also facing same
IjzerenHein commentedon Jan 21, 2025
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) asnextto 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 🙏
LegendProjects commentedon Jan 22, 2025
You cannot use in expo sdk 52 SharedElements is not working at all doesn't do any animation
IjzerenHein commentedon Jan 23, 2025
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
LegendProjects commentedon Jan 23, 2025
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
IjzerenHein commentedon Jan 23, 2025
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#installationYou'll need to create a development-build
https://docs.expo.dev/develop/development-builds/create-a-build/
pfcodes commentedon Feb 6, 2025
I get this build error after upgrading to expo 52 development build
oscarguinane commentedon Feb 18, 2025
Temporary fix: #128