question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash when parent's size is 0

See original GitHub issue

Hello,

I haven’t got enough time to investigate why this happens but sometimes the function private fun createBitmap(): Bitmap = Bitmap.createBitmap(parent.width, parent.height, Bitmap.Config.ALPHA_8) throws a java.lang.IllegalArgumentException: width and height must be > 0 because the size of the parent is equal to 0.

I’ve put on my fork a fast fix which is “check the size and if 0 use 1”, but I don’t think this is the way to correctly solve the issue, even if it works and the crash is avoided.

If needed you can check it here

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Faltenreichcommented, Mar 20, 2019

Skeleton applied directly on View within a RecyclerView - that hint should point me in the right direction. I will try to reproduce it and investigate the problem. Thanks again and have nice day!

1reaction
Faltenreichcommented, Mar 19, 2019

Thank you for your bug report and investigation! I will try to catch the problem before the IllegalArgumentException occurs. I assume lifecycle problems but I will take my time to find the root of this problem. Do you experience this bug when applying the skeleton to a View, to a RecyclerView or both? When this bug is fixed, I will release a new version including your androidx migration as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash in iOS 15 EXC_CRASH (SIGKILL… - Apple Developer
We are seeing crashes on iOS 15 (unreproducible on iOS 14) being reported without any Termination Reason or Code.
Read more >
Police Continue to Investigate Deadly Redwood City Crash
The deadly car crash Friday night in Redwood City left two young girls without parents, family members tell NBC Bay Area.
Read more >
Bug: RecyclerView can cause a crash when its parent ...
The view size become 0 and no element is displayed.
Read more >
Fatal crash in Redwood City leaves 2 kids without parents
A crash in Redwood City has left two 7-year-old girls without parents as community members are looking for better traffic safety measures in ......
Read more >
Keeping children safe in crashes: Overview - YouTube
For parents of all childrenMore than 1000 children 12 and younger die in passenger vehicles crashes every year, and more than 100000 are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found