java.lang.NoSuchMethodError: android.graphics.Bitmap.getByteCount

Appcelerator JIRA | Brian Lonsdorf | 4 years ago
  1. 0

    App crashes when we're loading images only on Honeycomb. Works on Android 2.3.3 and 4.0. Checked the android docs with Matt and found getByteCount was introduced in api level 12. This link seems to indicated that we're checking on >= when it should be > since the API_LEVEL_HONEYCOMB is defined as 11. https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/util/TiImageLruCache.java Stack Trace: tStatusBar( 188): lights on I/ActivityManager( 131): Starting: Intent { cmp=com.playdom.mobile.gardensoftime/org.appcelerator.titanium.TiActivity (has extras) } from pid 556 W/InputManagerService( 131): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@40ac4738 (uid=10024 pid=257) I/WindowManager( 131): Setting rotation to 2, animFlags=0 D/Tablet/NotificationPanel( 188): notificationCount=1 D/Vold ( 81): USB connected E/AndroidRuntime( 556): FATAL EXCEPTION: main E/AndroidRuntime( 556): java.lang.NoSuchMethodError: android.graphics.Bitmap.getByteCount E/AndroidRuntime( 556): at org.appcelerator.titanium.util.TiImageLruCache.sizeOf(TiImageLruCache.java:45) E/AndroidRuntime( 556): at org.appcelerator.titanium.util.TiImageLruCache.sizeOf(TiImageLruCache.java:14) E/AndroidRuntime( 556): at android.support.v4.util.LruCache.safeSizeOf(LruCache.java:230) E/AndroidRuntime( 556): at android.support.v4.util.LruCache.put(LruCache.java:123) E/AndroidRuntime( 556): at ti.modules.titanium.ui.widget.TiUIImageView$2.loadImageFinished(TiUIImageView.java:134) E/AndroidRuntime( 556): at org.appcelerator.titanium.util.TiLoadImageManager.handleLoadImageMessage(TiLoadImageManager.java:90) E/AndroidRuntime( 556): at org.appcelerator.titanium.util.TiLoadImageManager.handleMessage(TiLoadImageManager.java:107) E/AndroidRuntime( 556): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 556): at android.os.Looper.loop(Looper.java:126) E/AndroidRuntime( 556): at android.app.ActivityThread.main(ActivityThread.java:3997) E/AndroidRuntime( 556): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 556): at java.lang.reflect.Method.invoke(Method.java:491) E/AndroidRuntime( 556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) E/AndroidRuntime( 556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) E/AndroidRuntime( 556): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 131): Force finishing activity com.playdom.mobile.gardensoftime/org.appcelerator.titanium.TiActivity W/ActivityManager( 131): Activity pause timeout for ActivityRecord{40da9fb8 com.playdom.mobile.gardensoftime/org.appcelerator.titanium.TiActivity} D/Vold ( 81): USB disconnected D/Tablet/NotificationPanel( 188): notificationCount=0 D/Tablet/NotificationPanel( 188): notificationCount=1 D/Vold ( 81): USB connected W/ActivityManager( 131): Launch timeout has expired, giving up wake lock! W/ActivityManager( 131): Activity idle timeout for ActivityRecord{40ce8360 com.playdom.mobile.gardensoftime/.GardensActivity} W/ActivityManager( 131): Activity destroy timeout for ActivityRecord{40da9fb8 com.playdom.mobile.gardensoftime/org.appcelerator.titanium.TiActivity} I/WindowManager( 131): WIN DEATH: Window{40daab20 com.playdom.mobile.gardensoftime/com.playdom.mobile.gardensoftime.GardensActivity paused=false} I/ActivityManager( 131): Process com.playdom.mobile.gardensoftime (pid 556) has died.

    Appcelerator JIRA | 4 years ago | Brian Lonsdorf
    java.lang.NoSuchMethodError: android.graphics.Bitmap.getByteCount
  2. 0

    App crashes when we're loading images only on Honeycomb. Works on Android 2.3.3 and 4.0. Checked the android docs with Matt and found getByteCount was introduced in api level 12. This link seems to indicated that we're checking on >= when it should be > since the API_LEVEL_HONEYCOMB is defined as 11. https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/util/TiImageLruCache.java Stack Trace: tStatusBar( 188): lights on I/ActivityManager( 131): Starting: Intent { cmp=com.playdom.mobile.gardensoftime/org.appcelerator.titanium.TiActivity (has extras) } from pid 556 W/InputManagerService( 131): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@40ac4738 (uid=10024 pid=257) I/WindowManager( 131): Setting rotation to 2, animFlags=0 D/Tablet/NotificationPanel( 188): notificationCount=1 D/Vold ( 81): USB connected E/AndroidRuntime( 556): FATAL EXCEPTION: main E/AndroidRuntime( 556): java.lang.NoSuchMethodError: android.graphics.Bitmap.getByteCount E/AndroidRuntime( 556): at org.appcelerator.titanium.util.TiImageLruCache.sizeOf(TiImageLruCache.java:45) E/AndroidRuntime( 556): at org.appcelerator.titanium.util.TiImageLruCache.sizeOf(TiImageLruCache.java:14) E/AndroidRuntime( 556): at android.support.v4.util.LruCache.safeSizeOf(LruCache.java:230) E/AndroidRuntime( 556): at android.support.v4.util.LruCache.put(LruCache.java:123) E/AndroidRuntime( 556): at ti.modules.titanium.ui.widget.TiUIImageView$2.loadImageFinished(TiUIImageView.java:134) E/AndroidRuntime( 556): at org.appcelerator.titanium.util.TiLoadImageManager.handleLoadImageMessage(TiLoadImageManager.java:90) E/AndroidRuntime( 556): at org.appcelerator.titanium.util.TiLoadImageManager.handleMessage(TiLoadImageManager.java:107) E/AndroidRuntime( 556): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 556): at android.os.Looper.loop(Looper.java:126) E/AndroidRuntime( 556): at android.app.ActivityThread.main(ActivityThread.java:3997) E/AndroidRuntime( 556): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 556): at java.lang.reflect.Method.invoke(Method.java:491) E/AndroidRuntime( 556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) E/AndroidRuntime( 556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) E/AndroidRuntime( 556): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 131): Force finishing activity com.playdom.mobile.gardensoftime/org.appcelerator.titanium.TiActivity W/ActivityManager( 131): Activity pause timeout for ActivityRecord{40da9fb8 com.playdom.mobile.gardensoftime/org.appcelerator.titanium.TiActivity} D/Vold ( 81): USB disconnected D/Tablet/NotificationPanel( 188): notificationCount=0 D/Tablet/NotificationPanel( 188): notificationCount=1 D/Vold ( 81): USB connected W/ActivityManager( 131): Launch timeout has expired, giving up wake lock! W/ActivityManager( 131): Activity idle timeout for ActivityRecord{40ce8360 com.playdom.mobile.gardensoftime/.GardensActivity} W/ActivityManager( 131): Activity destroy timeout for ActivityRecord{40da9fb8 com.playdom.mobile.gardensoftime/org.appcelerator.titanium.TiActivity} I/WindowManager( 131): WIN DEATH: Window{40daab20 com.playdom.mobile.gardensoftime/com.playdom.mobile.gardensoftime.GardensActivity paused=false} I/ActivityManager( 131): Process com.playdom.mobile.gardensoftime (pid 556) has died.

    Appcelerator JIRA | 4 years ago | Brian Lonsdorf
    java.lang.NoSuchMethodError: android.graphics.Bitmap.getByteCount
  3. 0

    Android App with Android Studio crashes because of org.json.XML

    Stack Overflow | 2 months ago | GinSonic
    java.lang.IllegalStateException: Could not execute method for android:onClick
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.lang.NoSuchMethodError

    GitHub | 2 months ago | kimalec
    java.lang.NoSuchMethodError: org.json.JSONObject.wrap

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      android.graphics.Bitmap.getByteCount

      at org.appcelerator.titanium.util.TiImageLruCache.sizeOf()
    2. org.appcelerator.titanium
      TiImageLruCache.sizeOf
      1. org.appcelerator.titanium.util.TiImageLruCache.sizeOf(TiImageLruCache.java:45)
      2. org.appcelerator.titanium.util.TiImageLruCache.sizeOf(TiImageLruCache.java:14)
      2 frames
    3. Android Support v4
      LruCache.put
      1. android.support.v4.util.LruCache.safeSizeOf(LruCache.java:230)
      2. android.support.v4.util.LruCache.put(LruCache.java:123)
      2 frames
    4. ti.modules.titanium
      TiUIImageView$2.loadImageFinished
      1. ti.modules.titanium.ui.widget.TiUIImageView$2.loadImageFinished(TiUIImageView.java:134)
      1 frame
    5. org.appcelerator.titanium
      TiLoadImageManager.handleMessage
      1. org.appcelerator.titanium.util.TiLoadImageManager.handleLoadImageMessage(TiLoadImageManager.java:90)
      2. org.appcelerator.titanium.util.TiLoadImageManager.handleMessage(TiLoadImageManager.java:107)
      2 frames
    6. Android Platform
      ActivityThread.main
      1. android.os.Handler.dispatchMessage(Handler.java:95)
      2. android.os.Looper.loop(Looper.java:126)
      3. android.app.ActivityThread.main(ActivityThread.java:3997)
      3 frames
    7. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:491)
      2 frames
    8. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
      2 frames
    9. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame