react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Shared Element Transitions not working for Android in Release build with Proguard enabled.

Open jerinjohnk opened this issue 2 years ago • 4 comments

Description

On enabling proguard and creating release build

-keep class com.swmansion.reanimated.** { *; }
-keep class com.facebook.react.turbomodule.** { *; }

shared transitions stop working in the android release build.

In the minimal repo inside App.tsx I am calling ManyScreensExample to test the transition.

Steps to reproduce

In main branch run npx react-native build-android --mode=release

https://github.com/software-mansion/react-native-reanimated/assets/11266456/96f1babe-c8e4-4bce-b439-36f2b3321dc4

If we create a build with proguard rules disabled, it works fine.

Snack or a link to a repository

https://github.com/jerinjohnk/reanimatedTest/tree/main

Reanimated version

3.1.0

React Native version

0.71.7

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

Motorola g(40) fusion

Acknowledgements

Yes

jerinjohnk avatar Jul 06 '23 16:07 jerinjohnk

I'm facing the same issue when proguard is enable. Any help guys? Thank you

anhquan291 avatar Aug 10 '23 15:08 anhquan291

In the official docs version 3.x there's no mention of usage of proguard rules.

I also want to know if the proguard from reanimated 2 still applies here.

dennis-gonzales avatar Aug 21 '23 07:08 dennis-gonzales

facing the same issue when enabling proguard any update on this?

tanujs95 avatar Sep 04 '23 11:09 tanujs95

It works for me by adding this rule:

-keep class com.swmansion.** { *; }

I don't have much insight on what Java classes are necessary for this to work but it seems there are other classes involded here.

hanyufoodles avatar Oct 23 '23 07:10 hanyufoodles