Canvas: trying to use a recycled bitmap

Discussion in 'Help & Support' started by James Rebello, Jun 6, 2013.

  1. James Rebello Active Member

    Member Since:
    Mar 28, 2013
    Message Count:
    70
    Likes Received:
    31
    Trophy Points:
    50
    I'm getting this error on my crash report in Google Play. Here's the log from from Google Play

    java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@41f5e658
    at android.graphics.Canvas.throwIfRecycled(Canvas.java:1026)
    at android.graphics.Canvas.drawBitmap(Canvas.java:1065)
    at com.creativeeye.serenerainlwp.SBLiveWallpaper$LwpEngine.draw(SBLiveWallpaper.java:1025)
    at com.creativeeye.serenerainlwp.SBLiveWallpaper$LwpEngine.drawFrame(SBLiveWallpaper.java:866)
    at com.creativeeye.serenerainlwp.SBLiveWallpaper$LwpEngine.onVisibilityChanged(SBLiveWallpaper.java:758)
    at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:746)
    at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:796)
    at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:1041)
    at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5059)
    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:792)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
    at dalvik.system.NativeStart.main(Native Method)

    I guess this is something to do with the recycle method being called in the getWallpaperResource method. It seems however that it only recycles a temporary object that is not required later. I am not able to reproduce this error on my phone while testing.
  2. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    I'm having the exact same crash report in three of my lwps on Google Play with the exception that my package name is the standard com.sbg.lwc.
    They were all made using lwc 2.6
    Also, same as you I haven't had that crash on my phone.
  3. Fando Administrator

    Member Since:
    Jan 8, 2012
    Message Count:
    134
    Likes Received:
    55
    Trophy Points:
    100
    @Eraste @NewKid

    This error happens when you try to draw a bitmap that is null. There are safety checks that safeguard against this issue in 2.6, which clearly appear to be insufficient in all cases. This issue will be fixed in the new update soon enough. Meanwhile do not worry, this issue is rare and the live wallpaper recovers (re-loads) after the crash.
    virajith and NewKid like this.
  4. James Rebello Active Member

    Member Since:
    Mar 28, 2013
    Message Count:
    70
    Likes Received:
    31
    Trophy Points:
    50
    Hmmm ok....thanks Fando
  5. virajith Active Member

    Member Since:
    Dec 2, 2012
    Message Count:
    71
    Likes Received:
    10
    Trophy Points:
    50
    even i got this error ...hope it will get fixed soon

Share This Page