java.lang.RuntimeException: Unable to start activity ComponentInfo{com.technologyfortomorrow.animalyze/com.technologyfortomorrow.animalyze.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.release()' on a null object reference

tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Camera is being returned as a null object when compiled

    Stack Overflow | 8 months ago | Noah Tanenholtz
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.technologyfortomorrow.animalyze/com.technologyfortomorrow.animalyze.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.release()' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.hardware.Camera.release()' on a null object reference

      at com.technologyfortomorrow.animalyze.MainActivity.getCameraInstance()
    2. com.technologyfortomorrow.animalyze
      MainActivity.onCreate
      1. com.technologyfortomorrow.animalyze.MainActivity.getCameraInstance(MainActivity.java:181)
      2. com.technologyfortomorrow.animalyze.MainActivity.onCreate(MainActivity.java:88)
      2 frames
    3. Android Platform
      ActivityThread.performLaunchActivity
      1. android.app.Activity.performCreate(Activity.java:6272)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
      3 frames