Giphy / giphy-react-native-sdk

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

com.giphyreactnativesdk.GiphyRNMediaView cannot be cast to android.view.ViewGroup #93

Closed gprinc-hu closed 1 year ago

gprinc-hu commented 1 year ago

🐛 Bug Report

When I tried to display a selected gif from GiphyDialog, my app crashes and the error displayed is that GiphyMediaView cannot be casted to android.view.ViewGroup. This bug only appears to happen in Android, not in iOS. I am uploading a gif withe the same actions in android and in iOS to see what happens in each platform.

To Reproduce

(Write your steps here:)

  1. Step 1. Select a Gif from the displayer in GiphyDialog on Android
  2. Step 2. Display selected gif using GiphyMediaView on Android

Expected behavior

When I want to display the gif, it should appear the same way as in iOS.

Actual Behavior

When I display the gif, the app crashes in Android. In the simulator I can see this error popping up:

Screenshot 2023-01-24 at 13 30 47

Your Environment

Reproducible Demo

Android: https://user-images.githubusercontent.com/111156624/214352796-69296a01-0894-48ad-b9c7-3dc765ef564c.mp4

iOS: https://user-images.githubusercontent.com/111156624/214352878-bcd6e9fe-8b18-4211-84df-a6a46f417a21.mp4

gprinc-hu commented 1 year ago

I found the issue. I was passing an incorrect set of props and styles to GifMediaView and it was causing this issue.