Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underflow in restore - more restores than saves : on Android M (6.0) #76

Closed
arsalancode opened this issue Sep 9, 2015 · 41 comments · Fixed by #92
Closed

Underflow in restore - more restores than saves : on Android M (6.0) #76

arsalancode opened this issue Sep 9, 2015 · 41 comments · Fixed by #92

Comments

@arsalancode
Copy link

09-09 08:42:48.592 13857 13857 E AndroidRuntime: java.lang.IllegalStateException: Underflow in restore - more restores than saves
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.graphics.Canvas.native_restore(Native Method)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.graphics.Canvas.restore(Canvas.java:540)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at com.andexert.library.RippleView.draw(RippleView.java:166)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15174)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15134)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewRootImpl.draw(ViewRootImpl.java:2615)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:670)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:606)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
09-09 08:42:48.592 13857 13857 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

@arsalancode arsalancode changed the title Underflow in restore - more restores than saves Underflow in restore - more restores than saves : on Android M (6.0) Sep 9, 2015
@matthewrice345
Copy link

I get this error too.

@fleficher
Copy link

Same thing on Nexus 6 on Android 6.0 Build MPA44G.
Seems to be a Android bug, i've checked and there are as many restores as saves...

@esiek
Copy link

esiek commented Sep 23, 2015

I get this error too.

@JolandaVerhoef
Copy link

This is still crashing in the Official release of Android 6.0 that Google is rolling out.

@varunrramani
Copy link

Even I'm getting the same error on Android One device running Android 6.0

@gilgil28
Copy link

same here...

@JolandaVerhoef
Copy link

I moved over to com.balysv:material-ripple:1.0.2, that library doesn't crash.

It seems to crash for us when we open another app from a button. Then when we return to the app, it tries to finish the ripple animation and crashes.

@varunrramani
Copy link

@JolandaVerhoef check #74 comment by matthewrice345. He suggests modifying the source code.

@akbarsha03
Copy link

Same issue here... Gonna place a separate layout for 21+

@vipinshukla83
Copy link

I am also getting same error on Android 6.0

@akbarsha03
Copy link

@vipinshukla83 Place separate layout for 21+ let the Android M handle the ripple itself. Just use the proper ripple holder for layouts and views

@EliasGabrielsson
Copy link

I also have this problem, Android 6.0

1 similar comment
@loveanao
Copy link

I also have this problem, Android 6.0

@dariav
Copy link

dariav commented Jan 30, 2016

I've just created PR for this.
In case you don't want to wait for it and can use JitPack in your project you can get the fix by using

compile 'com.github.Hitta:RippleEffect:82cf00e551'

in your build.gradle file

@rex3du
Copy link

rex3du commented Feb 12, 2016

@dariav compile 'com.github.Hitta:RippleEffect:82cf00e551' is not working for me

@dariav
Copy link

dariav commented Feb 12, 2016

@rex3du Have you tried adding JitPack repository to your build file

repositories {
            ...
            maven { url "https://jitpack.io" }
        }

@rex3du
Copy link

rex3du commented Feb 15, 2016

@dariav Thanks.

@traex traex closed this as completed in #92 Feb 24, 2016
@ghost
Copy link

ghost commented Feb 25, 2016

Hi, i am using this library in my project and I can see you made the changes to fix the error with marshmallow. However I don't know how to apply/get/make those fixes in my project.

@GirishBhalerao
Copy link

This has very simple solution. Just downgrade your - targetSdkVersion to 22
It works for all versions.

@GirishBhalerao
Copy link

There are two solutions for this Problem.

  1. As I mentioned before - "Just downgrade your - targetSdkVersion to 22
    It works for all versions" - This works fine if you have not launched your app with targetSdkVersion 23 yet.
  2. If you already have launched your app with targetSdkVersion 23 then,
    instead of adding compile 'com.github.traex.rippleeffect:library:1.3' in dependancies,
    Download the project by clicking on link - https://codeload.github.com/traex/RippleEffect/zip/master
    Get library from that and use that in your app. It works great...!!! :)

@dushan135
Copy link

@GirishBhalerao how to get the library and import it to my app??

@Gloomyer
Copy link

Gloomyer commented Jul 6, 2016

Me too, in Xiaomi android 6.0.

@levi-mendes
Copy link

Me too Motorola Moto G Android 6.0.

@Jaftem
Copy link

Jaftem commented Aug 18, 2016

Getting this on Android 7.0, Nexus 6p.

@AresCool
Copy link

AresCool commented Sep 1, 2016

I also have this problem, Android 6.0.How do you solve it ?

@foxcode7
Copy link

foxcode7 commented Oct 8, 2016

i also have this problem on Android 7.0, Nexus 6p.

@williamthegrey
Copy link

I Got this problem too on Android 7.0, Nexus 5X.

@XuanGao2023
Copy link

I Got this too.

@suyashbhagwat
Copy link

@GirishBhalerao works well on Android 7.0 on Nexus 6 ..
Thanks..

@Sajini12
Copy link

Does this issue takes place only on button, or the error occurs on Cardview as well. I am using a cardview and not getting any crash.

@dingypgit
Copy link

call canvas.save(); before every restore()

@franklinexpress
Copy link

Getting this too, android 6

@bravolover520
Copy link

android 自定义view报如下错误: java.lang.IllegalStateException: Underflow in restore
原因:在自定义view里面调用了如下方法来保存画布的bitmap图像;
mCanvas.restore()
解决方法:改成:
mCanvas.save();
mCanvas.restore();
Okay!解决!

@patrickpissurno
Copy link

Please try this fixed version as alternative (you can use any targetSdkVersion): https://github.com/patrickpissurno/RippleEffect/

@Rafiqgithub
Copy link

@patrickpissurno
Thanks man its working now error free.

@ErickDaniel
Copy link

@bravolover520 work 4me

@chrissen0814
Copy link

l have the same problem and the version 1.3.1 is not working for me. Android 6.0.1

@shahilpb
Copy link

shahilpb commented Feb 1, 2018

Same problem

@SuperBeagleDog
Copy link

SuperBeagleDog commented Mar 9, 2018

I did as bravolover520 said (commented on 12 Jan 2017) == Called canvas.save(); Before canvas.restore();
Anyway, I can't change the source code. So that I copied the source and created a new one to fix this problem..

@eingurat504
Copy link

I fixed this issue using this version of RippleEffect https://github.com/patrickpissurno/RippleEffect/

@ski96277
Copy link

ski96277 commented Nov 5, 2018

Use this. It's Work For me,

implementation 'com.patrickpissurno:ripple-effect:1.3.1'`

More details -------------

https://github.com/patrickpissurno/RippleEffect/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.