Crash when parent's size is 0
See original GitHub issueHello,
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:
- Created 5 years ago
- Comments:10 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!
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.