ProGuard configuration required for version 1.2.0
See original GitHub issueDescription
I have updated fresco library version from 1.1.0 to 1.2.0 and tried to build the project with ProGuard.
It seems like the build fails due to the obfuscation of two specific annotations that fresco depends on, starting from 1.2.0, which are
com.facebook.infer.annotation.ReturnsOwnership
com.facebook.infer.annotation.Functional
The error message is below:
Warning: com.facebook.common.util.TriState: can't find referenced class com.facebook.infer.annotation.Functional
Warning: com.facebook.common.util.TriState: can't find referenced class com.facebook.infer.annotation.Functional
Warning: com.facebook.common.util.TriState: can't find referenced class com.facebook.infer.annotation.Functional
Warning: com.facebook.common.util.TriState: can't find referenced class com.facebook.infer.annotation.Functional
Warning: com.facebook.common.util.TriState: can't find referenced class com.facebook.infer.annotation.Functional
Warning: com.facebook.common.util.TriState: can't find referenced class com.facebook.infer.annotation.Functional
Warning: com.facebook.common.util.TriState: can't find referenced class com.facebook.infer.annotation.Functional
Warning: com.facebook.common.util.TriState: can't find referenced class com.facebook.infer.annotation.Functional
Warning: com.facebook.drawee.controller.AbstractDraweeControllerBuilder: can't find referenced class com.facebook.infer.annotation.ReturnsOwnership
Warning: com.facebook.drawee.generic.GenericDraweeHierarchyInflater: can't find referenced class com.facebook.infer.annotation.ReturnsOwnership
....
FAILURE: Build failed with an exception.
Reproduction
The build fails for every attempt when updating fresco library version from 1.1.0 to 1.2.0. The build succeeds if the library version is specified to 1.1.0.
Additional Information
- Fresco version: 1.2.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
ProGuard Manual: Version History - Guardsquare
Enabled as-needed execution in Gradle task. Using standard string interpolation for Gradle configuration. Reduced log levels for console output in Gradle task.
Read more >Configuring ProGuard | CodePath Android Cliffnotes
ProGuard can be enabled by using the minifyEnabled option for any build type. If you intend to use it for production, it is...
Read more >ProGuard Troubleshooting
Your configuration contains a -keep option to preserve the given method (or field), but no -keep option for the given class that is...
Read more >Failed to instantiate AndroidPlatform class using ProGuard
It is expected for the release version of the Android app's build to run ... What ProGuard configuration do I need for Firebase...
Read more >Introduce separate proguard configuration for androidTest ...
Essentially the gradle-based build will use the same proguard configuration also for the test app and in my case crashes the application very...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oops…my bad; I haven’t checked that documentation. Thanks for your info!
(By the way, in the future, possibly fresco could contain
consumerProguardFiles
configuration on its build.gradle file to include those ProGuard settings within the library itself so that users may no longer need to set up additional ProGuard setting on top of their own. 😃 (Glide seems to have done this already; I have pasted the code ref below as well).Reference I have looked up:
Anyway, thanks for your quick response and help!
@foghina Thank you for the quick response; adding these two
dontwarn
configuration fixes build failure and made the build to succeed for me.Hopefully this is the minimum configuration required to make the build succeed, but still I am not 100% sure simply
dontwarn
ing them solves the entire issue here.