java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Bitmap.setHasAlpha(boolean)' on a null object reference

Stack Overflow | Vivek | 1 month ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    Error in Bitmap create function for devices greater than API 22

    Stack Overflow | 1 month ago | Vivek
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Bitmap.setHasAlpha(boolean)' on a null object reference
  2. 0
    samebug tip
    Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    java.lang.IllegalArgumentException: bitmap size exceeds 32 bits

    Stack Overflow | 1 year ago | Photogd
    java.lang.RuntimeException: Unable to resume activity {com.pa.modelreleaseapp/com.pa.modelreleaseapp.EditActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=3, result=-1, data=Intent { (has extras) }} to activity {com.pa.modelreleaseapp/com.pa.modelreleaseapp.EditActivity}: java.lang.IllegalArgumentException: bitmap size exceeds 32 bits
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.NullPointerException

    Attempt to invoke virtual method 'void android.graphics.Bitmap.setHasAlpha(boolean)' on a null object reference

    at android.graphics.Bitmap.createBitmap()
  2. Android Platform
    Bitmap.createBitmap
    1. android.graphics.Bitmap.createBitmap(Bitmap.java:835)
    2. android.graphics.Bitmap.createBitmap(Bitmap.java:808)
    3. android.graphics.Bitmap.createBitmap(Bitmap.java:775)
    3 frames
  3. com.controller.activities
    SplashScreenActivity.onCreate
    1. com.controller.activities.SplashScreenActivity.onCreate(SplashScreenActivity.java:51)
    1 frame
  4. Android Platform
    ActivityThread.main
    1. android.app.Activity.performCreate(Activity.java:6248)
    2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
    3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2437)
    4. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2544)
    5. android.app.ActivityThread.access$900(ActivityThread.java:150)
    6. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394)
    7. android.os.Handler.dispatchMessage(Handler.java:102)
    8. android.os.Looper.loop(Looper.java:168)
    9. android.app.ActivityThread.main(ActivityThread.java:5845)
    9 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
    2 frames