-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Migrating to react-native 0.56 breaks Fresco's proguard config #2181
Comments
Worth noting I'm on implementation 'com.facebook.fresco:webpsupport:1.3.0'. I just upgraded to 1.10.0 to see what would happen and now I'm getting more ProGuard errors. 10:40:52.785 [ERROR] [system.err] Note: there were 23 duplicate class definitions. According to the Fresco docs, 1.9.0 and up ship with a built in proguard config that will be automatically applied. Is there something else I have to do in order to get the latest ProGuard config? |
So, I've realized this is partially my own fault: I only had this line in my build.gradle
and now I have
However, the issue is still present, just now there are only 6 warnings from proguard regarding SoLoader that aren't covered by the built in proguard config fresco is shipping automatically.
|
It looks like you're including SoLoader in both Fresco and React Native. I guess you have to exclude the dependency (com.facebook.soloader:soloader:...) |
I ended up solving this by downgrading to Fresco 1.9 |
Yes, you always have to use the same version as React Native as well. Glad you fixed the issue. |
We use GitHub Issues for bugs.
If you have a non-bug question, please ask on Stack Overflow: http://stackoverflow.com/questions/tagged/fresco
--- Please use this template, and delete everything above this line before submitting your issue ---
Description
I migrated from 0.55.4 to 0.56.0 and now ProGuard is failing my Android build. I think Fresco is getting one of its dependencies eliminated by ProGuard, so we need to write a keep line to prevent this. It would be nice to add this to the changelog of 0.56. Or alternatively, should react-native-upgrade do this automatically? I looked at your proguard template files, and they don't seem to have any lines that would fix this. I guess this may have just slipped under the radar.
10:16:29.581 [ERROR] [system.err] Warning: com.facebook.imagepipeline.nativecode.StaticWebpNativeLoader: can't find referenced class com.facebook.common.soloader.SoLoaderShim
10:16:29.581 [ERROR] [system.err] Warning: com.facebook.imagepipeline.nativecode.StaticWebpNativeLoader: can't find referenced class com.facebook.common.soloader.SoLoaderShim
10:16:31.897 [ERROR] [system.err] Warning: there were 2 unresolved references to classes or interfaces
Reproduction
Upgrade to rn 0.56, turn on proguard, and try to build the android project with Facebook's built in proguard template. Observe that the above class is not found by Fresco and fails the build.
Solution
Someone needs to write a keep rule for this and either document it or make Fresco automatically share its proguard config
The text was updated successfully, but these errors were encountered: