java - Using AppCompat 'layout_behavior' with '@string/appbar_scrolling_view_behavior' throws exception -
i have strange probem using appcompat lib 22.2 new introduced: layout_behavior
if use value "@string/appbar_scrolling_view_behavior" , described here android design support lib application terminates following exception:
could not inflate behavior subclass android.support.design.widget.settings caused by: java.lang.runtimeexception: not inflate behavior subclass android.support.design.widget.settings caused by: java.lang.classnotfoundexception: android.support.design.widget.settings caused by: java.lang.noclassdeffounderror: android/support/design/widget/settings caused by: java.lang.classnotfoundexception: android.support.design.widget.settings
if change :
app:layout_behavior="android.support.design.widget.appbarlayout$scrollingviewbehavior"
everything works fine.
what i'm missing ?
for others encounter exception , use proguard - need add following proguard rules:
-keep class android.support.design.widget.** { *; } -keep interface android.support.design.widget.** { *; } -dontwarn android.support.design.**
or if don't want keep of design library components can use:
-keepattributes *annotation* -keep public class * extends android.support.design.widget.coordinatorlayout.behavior { *; } -keep public class * extends android.support.design.widget.viewoffsetbehavior { *; }
Comments
Post a Comment