java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.android.snake.Sounds.playHitSound()' on a null object reference

Stack Overflow | Jeremy | 2 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    add sound to android (not main class)

    Stack Overflow | 2 months ago | Jeremy
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.android.snake.Sounds.playHitSound()' on a null object reference
  2. 0

    Android Snake Game (How to add audio)?

    Stack Overflow | 2 months ago | scsims
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    GitHub comment 103#21551427

    GitHub | 4 years ago | zwl
    java.lang.VerifyError: com/example/android/snake/SnakeView
  5. 0

    Android App crashing due to error in code, don't understand logcat messages

    Stack Overflow | 6 years ago | Ed Higgins
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dalimited.zs/com.dalimited.zs.Snake}: android.view.InflateException: Binary XML file line #21: Error inflating class com.example.android.snake.SnakeView

    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 com.example.android.snake.Sounds.playHitSound()' on a null object reference

      at com.example.android.snake.SnakeView.updateSnake()
    2. com.example.android
      SnakeView$RefreshHandler.handleMessage
      1. com.example.android.snake.SnakeView.updateSnake(SnakeView.java:484)
      2. com.example.android.snake.SnakeView.update(SnakeView.java:410)
      3. com.example.android.snake.SnakeView$RefreshHandler.handleMessage(SnakeView.java:117)
      3 frames
    3. Android Platform
      ActivityThread.main
      1. android.os.Handler.dispatchMessage(Handler.java:102)
      2. android.os.Looper.loop(Looper.java:154)
      3. android.app.ActivityThread.main(ActivityThread.java:6119)
      3 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      1 frame
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
      2 frames