Erik Pedersen Erik Pedersen - 4 months ago 34
Android Question

appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2

We just changed our application to use the

appcompat-v7 support
library in order to take advantage of the support actionbar and support Material themes. Using
v21.0.0 of appcompat-v7
v21.0.0 of support-v4)
, we are now seeing crashes in
Google Play
and Crashlytics only from Samsung devices
Android v4.2.2
. Here is the stack trace from Google Play and the app appears to crash as soon as the
actionbar` is shown and/or invalidated.

at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(
at dalvik.system.NativeStart.main(Native Method)

Other devices and emulators running v4.2.2 do no exhibit this behavior. It's my understanding that many Google apps are already using this new version of
to display the action bar. If these apps are not reporting crashes on these devices, it would be helpful to know how this is being avoided/fixed.

I reported this as a bug to Google but it got closed with the reason that it is a development issue. Although I do agree this may be the case, I'm wondering if/how anyone is currently able to use
appcompat-v7 v21.0.0
and not get crashes on
Samsung 4.2.2 devices

Update: It looks like Google is at least considering possible workarounds for this. See this for details.


I found the proper solution here:

By using

-keep class !**,** {*;}

instead of

-keep class** {*;}