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

v2.13 App crash while monkey testing (java.lang.IllegalArgumentException: width and height must be > 0) #2643

Closed
derpomorj opened this issue Mar 5, 2024 · 1 comment · Fixed by #2645
Milestone

Comments

@derpomorj
Copy link

Description

The application crashes while running monkey tests with LeakCanary enabled
stacktrace:

FATAL EXCEPTION: LeakCanary-Activity-DB
java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:1197)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1163)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1111)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1070)
at leakcanary.internal.activity.screen.HeapDumpRenderer.render(HeapDumpRenderer.kt:173)
at leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$$inlined$apply$lambda$2$1.invoke(RenderHeapDumpScreen.kt:51)
at leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$$inlined$apply$lambda$2$1.invoke(RenderHeapDumpScreen.kt:47)
at leakcanary.internal.activity.db.Io$execute$2.invoke(Io.kt:45)
at leakcanary.internal.activity.db.Io$execute$2.run(Io.kt:10)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)

Steps to Reproduce

  1. run monkey test (example comand adb shell monkey -p your.package.name -v 500000)
  2. wait
  3. app crashed

Expected behavior:
app did not crash

Version Information

  • LeakCanary version: 2.13
  • Android OS version: 13
  • Gradle version: 7.6.3 (AGP 7.4.1)
@pyricau
Copy link
Member

pyricau commented Mar 26, 2024

yep I could see this happen. in RenderHeapDumpScreen, in onGlobalLayout, we should extract measuredWidth and measuredHeight before calling executeOnIo()

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

Successfully merging a pull request may close this issue.

2 participants