user2227682 user2227682 - 4 months ago 9
Android Question

Error after publish apk on Play Store

If i run the app direct of Android Studio to my smartphone the app works correctly but if downloaded my app on Play Store, the app stop and show me the follow errors:

android.view.InflateException: Binary XML file line #25: Binary XML file line #25: Error inflating class android.support.design.widget.NavigationView
Binary XML file line #25: Error inflating class android.support.design.widget.NavigationView
Binary XML file line #17: Unable to find LayoutManager android.support.v7.widget.LinearLayoutManager


May somebody help me?
Thank you.

EDIT: WORKS CHANGE ON GRADLE
compile 'com.android.support:design:23.1.0'
to
compile 'com.android.support:design:23.1.1'

Answer

I'm assuming you're running into the same issue with ProGuard that I nearly went bald over a few months back. Try adding this to your proguard rules file:

# https://code.google.com/p/android/issues/detail?id=78377
# https://code.google.com/p/android/issues/detail?id=78377#c188
#-keep class !android.support.v7.internal.view.menu.**,** { *; }   
# Apparently this was messed up again in v23 and explicitly specifying MenuBuilder is now required
-keep class !android.support.v7.internal.view.menu.*MenuBuilder* { *; }
-keep class !android.support.v7.view.menu.**,!android.support.design.internal.NavigationMenu,!android.support.design.internal.NavigationMenuPresenter,!android.support.design.internal.NavigationSubMenu,**

I noted the bug reports I found for the v21 issue (that also lead to the solution for the v23 issue)

Comments