Giphy / giphy-react-native-sdk

GIPHY React Native SDK
https://developers.giphy.com
Apache License 2.0
69 stars 25 forks source link

Gif Not Playing After Updating React Native to 0.76.1 and Giphy SDK to 3.3.1 #205

Closed GandhaSaputra closed 2 weeks ago

GandhaSaputra commented 2 weeks ago

🐛 Bug Report

I encountered an issue where GIFs are not playing as expected. Instead of animating, the GIFs appear as static images, and no playback occurs.

To Reproduce

  1. Update React Native to version 0.76.1.
  2. Update giphy-react-native-sdk to version 3.3.1.
  3. add this code to android/app/build.gradle and place before dependencies section configurations.all { resolutionStrategy { forcedModules = ['com.giphy.sdk:ui:2.3.15'] } }
  4. Load a GIF using the Giphy SDK (i'm using GiphyGridView)
  5. Observe that the GIF is not playing and remains a static image.

Expected behavior

The GIFs should play and animate as expected after loading.

Actual Behavior

GIFs are not playing as expected

Your Environment

I was using React Native version 0.72.7 and giphy-react-native-sdk version 3.2.5 before, and it worked smoothly.

ALexanderLonsky commented 2 weeks ago

Hey @GandhaSaputra, Thanks for flagging this!

Hmm, that’s interesting, it seems we're now seeing Fresco conflicts even with minor version differences. React Native 0.76.1 defaults to Fresco 3.2.0, while our SDK uses 3.1.3, causing static GIFs. I've tried a fix on my end:

configurations.configureEach {
    resolutionStrategy {
        forcedModules = ['com.facebook.fresco:fresco:3.2.0',
                         'com.facebook.fresco:animated-gif:3.2.0',
                         'com.facebook.fresco:animated-base:3.2.0',
                         'com.facebook.fresco:animated-drawable:3.2.0',
                         'com.facebook.fresco:animated-webp:3.2.0',
                         'com.facebook.fresco:webpsupport:3.2.0',
                         'com.facebook.fresco:imagepipeline-okhttp3:3.2.0',
                         'com.facebook.fresco:middleware:3.2.0',
                         'com.facebook.fresco:nativeimagetranscoder:3.2.0',
        ]
    }
}

Could you please give it a shot on yours?

GandhaSaputra commented 2 weeks ago

Thanks @ALexanderLonsky, it works perfectly now.

and to answer your question, yes, I'm disabling the new architecture

ALexanderLonsky commented 2 weeks ago

@GandhaSaputra Heh, I'm glad this resolved your issue, and thank you for your answer! I actually removed my question because the issue was on my end, I needed to manually run generateCodegenArtifactsFromSchema for my specific case.