Android Support Library 23.1.0 Proguard regression

Update: with the release of the Support Library 23.1.1 the issue has been fixed. You can update to that version and remove the rule in your ProGuard configuration file.


 

If you are using the Android Support Library, specifically the support-design, and the  NavigationDrawer , you could face a ProGuard issue while moving to version 23.1.0.

This is an example of the stack trace you could get: basically class  android.support.v7.widget.LinearLayoutManager gets obfuscated, so it cannot be retrieved at runtime.

"Caused by: java.lang.IllegalStateException: Binary XML file line #17: Unable to find LayoutManager android.support.v7.widget.LinearLayoutManager
at android.support.v7.widget.ca.a(Unknown Source)
at android.support.v7.widget.ca.<init>(Unknown Source)
at android.support.design.internal.NavigationMenuView.<init>(Unknown Source)
at android.support.design.internal.NavigationMenuView.<init>"

The issue has been already reported in the official Android Issue Tracker here, and at the time of writing it’s closed with a FutureRelease status.

In the meantime, you have two options:

  • keep using version 23.0.1
  • move to version 23.1.0 and add a new rule in your  proguard-rules.pro  file:
-keep class android.support.v7.widget.LinearLayoutManager { *; }

Leave a Reply

Your email address will not be published. Required fields are marked *