BubbleShowCase-Android
BubbleShowCase-Android copied to clipboard
IllegalArgumentException
Hi i randomly getting the error below
Fatal Exception: java.lang.IllegalArgumentException: y must be >= 0 at android.graphics.Bitmap.checkXYSign(Bitmap.java:408) at android.graphics.Bitmap.createBitmap(Bitmap.java:800) at android.graphics.Bitmap.createBitmap(Bitmap.java:769) at com.elconfidencial.bubbleshowcase.BubbleShowCase.takeScreenshotOfLayoutView(BubbleShowCase.kt:373) at com.elconfidencial.bubbleshowcase.BubbleShowCase.takeScreenshot(BubbleShowCase.kt:360) at com.elconfidencial.bubbleshowcase.BubbleShowCase.addTargetViewAtForegroundLayout(BubbleShowCase.kt:229) at com.elconfidencial.bubbleshowcase.BubbleShowCase.access$addTargetViewAtForegroundLayout(BubbleShowCase.kt:26) at com.elconfidencial.bubbleshowcase.BubbleShowCase$show$1.run(BubbleShowCase.kt:120) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Hi vijaemanlapaz,
I have been investigating the possible cause of this bug. It seems it occurs when the BubbleShowCase is trying to locate the target view and it is out of the root view bounds but inside of the screen when the BubbleShowCase tries to locate the target view.
I have just released a new version and I think this bug has been fixed. Please, let me know if this issue is still happening or not in your case, to keep open or close this issue.
implementation 'com.elconfidencial.bubbleshowcase:bubbleshowcase:1.3.1'
Thank you for reporting this bug.
hi, I am using 1.3.1, and I get a similar exception:
java.lang.IllegalArgumentException: y + height must be <= bitmap.height()
at android.graphics.Bitmap.createBitmap(Bitmap.java:536)
at android.graphics.Bitmap.createBitmap(Bitmap.java:501)
at com.elconfidencial.bubbleshowcase.BubbleShowCase.takeScreenshotOfLayoutView(BubbleShowCase.kt:361)
at com.elconfidencial.bubbleshowcase.BubbleShowCase.takeScreenshot(BubbleShowCase.kt:348)
at com.elconfidencial.bubbleshowcase.BubbleShowCase.addTargetViewAtBackgroundDimLayout(BubbleShowCase.kt:217)
at com.elconfidencial.bubbleshowcase.BubbleShowCase.access$addTargetViewAtBackgroundDimLayout(BubbleShowCase.kt:25)
at com.elconfidencial.bubbleshowcase.BubbleShowCase$show$1.run(BubbleShowCase.kt:108)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
The crash happens when the target where the bubble should be shown is not entire visible on the screen (it is inside a scrollview, and only one third of it is visible - this happens for example on smaller devices).
Please help us with this
This issue still occurs
Use
This solves the issue.
any update on this issue?
The issue might be caused if the view for the BubbleShowCase is now on the screen. I check if the view is on screen using this https://devanshuchandra.medium.com/android-how-to-determine-if-a-view-is-onscreen-offscreen-or-partially-offscreen-partially-visible-642e2cca1dbd