-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use GIF or WebP in a release apk, Fresco imagepipeline is stripped by ProGuard #7760
Comments
@facebook-github-bot label Android |
The first solution seems a bit better since it might avoid similar problems in the future. |
@AndrewJack I tested to display a GIF with react-native@0.27.0-rc1, it doesn't work since Fresco has been updated. (Without ProGuard)
|
@charpeni The fresco dependencies have been split, I missed that when upgrading. We either need to add a selection of these dependencies to the react-native library or allow users to add the gif/webp support themselves. // If your app supports Android versions before Ice Cream Sandwich (API level 14)
compile 'com.facebook.fresco:animated-base-support:0.10.0'
// For animated GIF support
compile 'com.facebook.fresco:animated-gif:0.10.0'
// For WebP support, including animated WebP
compile 'com.facebook.fresco:animated-webp:0.10.0'
compile 'com.facebook.fresco:webpsupport:0.10.0'
// For WebP support, without animations
compile 'com.facebook.fresco:webpsupport:0.10.0' I'll investigate further. cc @bestander |
It probably would not hurt to add gif/webp libs to RN because FB has all those libraries internally anyway. |
After adding react-natve @0.27.2 <View>
<Text>
<Text>Inline animated gif --> </Text>
<Image
style={{width: 20, height: 20}}
source={{uri: 'http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/5c/huanglianwx_org.gif'}}/>
</Text>
<Image
style={{width: 20, height: 20}}
source={{uri: 'http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/5c/huanglianwx_org.gif'}}/>
</View> |
First, let me say thanks to everyone on this ticket. You saved me a headache! I just ran into this problem. @bestander et al. I agree it would be nice to add the libs. 1, easy for those of us upgrading to expect continued support of what we've put in various projects. Thanks again! |
@mdluo Another bug on iOS: After pressing home key and then went back to the App,all the gif images disappeared. do you know reason? |
@mdluo @RongjieChen It will be fixed by #7612. |
Thank you all, I will close this issue and submit a pull request to ensure the best experience with Fresco to the React Native developers. |
Summary: Motivation facebook#7760 Closes facebook#7781 Differential Revision: D3397772 fbshipit-source-id: 02b6fd4a403da590fd1c55c554eca00e15899a03
Summary: Motivation facebook#7760 Closes facebook#7781 Differential Revision: D3397772 fbshipit-source-id: 02b6fd4a403da590fd1c55c554eca00e15899a03
Hi, I had the GIF support issue now it's working in react native android now I want to know how can I make GIF image corner rounded I tried 'borderRadius: 10' it's working on other image format PNG or JPG but it's not working with GIF images. |
@NitishAgrawal Can a workaround be that you wrap the image in a |
If we build an apk in release with ProGuard enabled, when we load a scene that include a GIF or WebP image from the Image component, the application will crash with the following error :
Tested with react-native@0.26.2.
Steps to reproduce
def enableProguardInReleaseBuilds = true
Proposed solution
Fresco documentation recommends the following ProGuard configuration :
So I tested this by adding it to the React Native proguard file like this :
I built the apk and everything worked fine.
An another solution would be to add this line to the proguard :
I'll do the pull request, but before that I just need your opinion.
Do you think this could have side effects?
Do you prefer a method?
Any other ideas?
cc @AndrewJack, @mkonicek, @janicduplessis
The text was updated successfully, but these errors were encountered: