skydoves / Cloudy

☁️ Jetpack Compose blur effect library, which falls back onto a CPU-based implementation to support older API levels.
Apache License 2.0
712 stars 26 forks source link

RuntimeException: Failed to copy pixels of the given bitmap! #22

Open msusman1 opened 3 months ago

msusman1 commented 3 months ago

Please complete the following information:

Describe the Bug:

Application Crashing

java.lang.RuntimeException: Failed to copy pixels of the given bitmap!
    at com.skydoves.cloudy.CloudyKt.drawBitmapWithPixelCopy$lambda$7(Cloudy.kt:281)
    at com.skydoves.cloudy.CloudyKt.$r8$lambda$X2Nw-BPO6_ca_Hnlrx5we4hyARg(Unknown Source:0)
    at com.skydoves.cloudy.CloudyKt$$ExternalSyntheticLambda0.onPixelCopyFinished(Unknown Source:6)
    at android.view.PixelCopy$1.run(PixelCopy.java:191)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7872)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
alizeyn commented 3 weeks ago

Same thing happens for me when navigating to another screen and navigating back to the screen in which cloudy is used.

java.lang.RuntimeException: Failed to copy pixels of the given bitmap!
    at com.skydoves.cloudy.CloudyKt.drawBitmapWithPixelCopy$lambda$7(Cloudy.kt:281)
    at com.skydoves.cloudy.CloudyKt.$r8$lambda$dvLUHhx2GzqWOBNcdQYzpkyw3bE(Unknown Source:0)
    at com.skydoves.cloudy.CloudyKt$$ExternalSyntheticLambda0.onPixelCopyFinished(D8$$SyntheticClass:0)
    at android.view.PixelCopy$1.lambda$onCopyFinished$0(PixelCopy.java:193)
    at android.view.PixelCopy$1$$ExternalSyntheticLambda0.run(Unknown Source:4)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:257)
    at android.os.Looper.loop(Looper.java:368)
    at android.app.ActivityThread.main(ActivityThread.java:8819)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
VeceluXa commented 1 week ago

@alizeyn Same happened with me. Have you found the solution?

skydoves commented 3 hours ago

Hey guys, the new version 0.2.0 has been released, and now you can resolve this issue by using the Modifier.cloudy modifier instead of the Cloudy composable function.