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

Illegal argument exception #58

Closed
baboog opened this issue May 30, 2018 · 9 comments
Closed

Illegal argument exception #58

baboog opened this issue May 30, 2018 · 9 comments

Comments

@baboog
Copy link

baboog commented May 30, 2018

Any pointers/hints please , getting following exception:

Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:850) at android.graphics.Bitmap.createBitmap(Bitmap.java:829) at android.graphics.Bitmap.createBitmap(Bitmap.java:796) at io.supercharge.shimmerlayout.ShimmerLayout.createBitmap(SourceFile:373) at io.supercharge.shimmerlayout.ShimmerLayout.getSourceMaskBitmap(SourceFile:322) at io.supercharge.shimmerlayout.ShimmerLayout.drawMask(SourceFile:2252) at android.view.View.draw(View.java:16305) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.draw(View.java:16305) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.draw(View.java:16305) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.draw(View.java:16305) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.support.v4.widget.DrawerLayout.drawChild(SourceFile:1367) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.draw(View.java:16305) at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2760) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:295) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:301) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:345) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2687) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2496) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2121) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6238) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:884) at android.view.Choreographer.doCallbacks(Choreographer.java:696) at android.view.Choreographer.doFrame(Choreographer.java:631) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:870) at android.os.Handler.handleCallback(Handler.java:743) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:150) at android.app.ActivityThread.main(ActivityThread.java:5621) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

@veghtomi
Copy link
Collaborator

Hi @baboog ! Can you reproduce this issue? I suggest using the newer version (2.1.0) of the library, the one you are using is an older one.

@baboog
Copy link
Author

baboog commented Jun 1, 2018

no , but my fabric has alot of these crashes
updating it and sending a update in few days , lets see
thanks

@veghtomi
Copy link
Collaborator

veghtomi commented Jun 4, 2018

Thanks @baboog ! Could you tell me the version you were using? This issue happens sometimes with the older version of the lib and I would like to investigate it! The only thing that I can think of is setting the view height to zero which can cause this kind of crash.

Until you send me updates, I am closing the issue. If it happens again, please open it.

@veghtomi veghtomi closed this as completed Jun 4, 2018
@baboog
Copy link
Author

baboog commented Jun 11, 2018

Hey @veghtomi
So we updated to 2.1.0
but the crash is still there...

it seems somehow the width is 0 even in the onPreDrawListener .. we breezed through the library code, ( not sure that is the root cause just a hunch) .. Sadly havent been able to reproduce it, But samsung is on top ( no surprise there :D )

screen shot 2018-06-11 at 11 18 48 am

@veghtomi
Copy link
Collaborator

I think that the height should be the one which is zero as the bitmap is not created if the width is zero. At the weekend I will check it and probably put a height check as well to startShimmerAnimation(). My question would be that are you using on a view of which height is set to zero by somehow?

@baboog
Copy link
Author

baboog commented Jun 14, 2018

will check and update
thanks

@baboog
Copy link
Author

baboog commented Jul 26, 2018

hey @veghtomi did u get chance to look into
"At the weekend I will check it and probably put a height check as well to startShimmerAnimation()"

@veghtomi
Copy link
Collaborator

Hi @baboog,

sorry, I forgot it! I will make up for it at this weekend and will write back.

@baboog
Copy link
Author

baboog commented Sep 24, 2018

thanks @veghtomi , let me know whenever possible 👍

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

No branches or pull requests

2 participants