When opening DialogFragment Gif with proguard / r8 enabled, the following message appears: "OH NO! SOMETHING WENT WRONG". What should I configure to work normally?
Asked
Active
Viewed 278 times
1 Answers
2
add this lines to your proguard rules file:
-keep class com.giphy.sdk.** {*;}
-keep class com.giphy.sdk.**
-keepclassmembers com.giphy.sdk.** { *; }

feridok
- 648
- 7
- 26
-
1The syntax require keyword `class` after `-keep`, so the rule should be `-keep class com.giphy.sdk.** {*;}`. The other two lines are not needed as they does not add anything. Now this rule is very quite broad, and defeats the purpose of shrinking that library. I suggest that you open an issue with Giphy SDK. If they provide an Android library they should ensure that their aar contains the rules required by the library. – sgjesse Jan 24 '20 at 14:22
-
@sgjesse thanks for your comment, I missed class keywords. – feridok Jan 24 '20 at 14:47
-
Thanks @feridok. One question for you: Any particulair reason why you don't think the the first rule that you have shouldn't be enough? The first should keep all classes with all members in the package `com.giphy.sdk`, whereas the next two should keep be strict subsets of that. – sgjesse Jan 29 '20 at 14:45