ChipsLayoutManager
ChipsLayoutManager copied to clipboard
ProGuard and Orientation annotation
dependency loaded from jCenter, ProGuard complains that it can not find Orientation
I also found these warning, the logs are below:
Warning:com.beloo.widget.chipslayoutmanager.ChipsLayoutManager: can't find referenced class com.beloo.widget.chipslayoutmanager.Orientation
Warning:com.beloo.widget.chipslayoutmanager.ChipsLayoutManager$Builder: can't find referenced class com.beloo.widget.chipslayoutmanager.Orientation
Warning:com.beloo.widget.chipslayoutmanager.IChipsLayoutManagerContract: can't find referenced class com.beloo.widget.chipslayoutmanager.Orientation
Warning:com.beloo.widget.chipslayoutmanager.IStateHolder: can't find referenced class com.beloo.widget.chipslayoutmanager.Orientation
I'm trying to keep everything related to ChipsLayoutManager with the following annotations:
-keep class com.beloo.widget.chipslayoutmanager.* { *; }
-keep class com.beloo.widget.chipslayoutmanager.*$* { *; }
I made some changes and by using the configuration below I do not get any ProGuard warnings.
-keep class com.beloo.widget.chipslayoutmanager.* { *; }
-keep class com.beloo.widget.chipslayoutmanager.** { *; }
-keep class com.beloo.widget.chipslayoutmanager.*$* { *; }
-keep class RestrictTo.*
-keep class RestrictTo.**
-keep class RestrictTo.*$*
These are very vague rules. It would be sufficient, if the jCenter library just contained the Orientations.java. I imported just that file in the project, and it works without any hassle.
Rules provided by @ihhcarus are not working on my case. I use -dontwarn rule to fix this temporarily.
-dontwarn com.beloo.widget.chipslayoutmanager.Orientation
But do you guys know the cause of this issue? Is it because the Orientation annotation is not kept when building the jar?
There is no Orientation annotation in the jar file.
And why there's no problem for building debug variant (of the app includes ChipsLayoutManager)?
One workaround for now, would be adding the Orientation.java to your project yourself, to the correct package.
Yes @egistli, what I posted was also not working that well for me.
I didn't comment back here again but I ended up using -dontwarn too to fix this temporarily.
@Krisztiaan Add the Orientation.java to the app project will resolve this issue but I prefer to keep third-party packages/files out of the app project and only referenced them via build.gradle.
Same problem here, is there a fix planned in a future version?
I got the same problem when trying to sign and build my application. The solution was to add "-dontwarn com.beloo.widget.chipslayoutmanager. **" in my file "proguard-rules.pro" Once this was done, it worked.
Regards.
@cristianireyes would it affect any functionality?