java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' on a null object reference

Stack Overflow | Aksh | 7 months ago
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

    Google+ signout method returns nullpointer exception

    Stack Overflow | 7 months ago | Aksh
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' on a null object reference

      at com.myapplication.tester.BaseActivity.signOut()
    2. com.myapplication.tester
      BaseActivity.onOptionsItemSelected
      1. com.myapplication.tester.BaseActivity.signOut(BaseActivity.java:190)
      2. com.myapplication.tester.BaseActivity.onOptionsItemSelected(BaseActivity.java:180)
      2 frames
    3. Android Platform
      Activity.onMenuItemSelected
      1. android.app.Activity.onMenuItemSelected(Activity.java:2948)
      1 frame
    4. Android Support v4
      FragmentActivity.onMenuItemSelected
      1. android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:406)
      1 frame
    5. Android v7
      ActionMenuView$MenuBuilderCallback.onMenuItemSelected
      1. android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:195)
      2. android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:103)
      3. android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:103)
      4. android.support.v7.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:69)
      5. android.support.v7.widget.Toolbar$1.onMenuItemClick(Toolbar.java:203)
      6. android.support.v7.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:759)
      6 frames
    6. android.support.v7
      MenuPopup.onItemClick
      1. android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:810)
      2. android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
      3. android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:957)
      4. android.support.v7.view.menu.MenuPopup.onItemClick(MenuPopup.java:127)
      4 frames
    7. Android Platform
      AdapterView.performItemClick
      1. android.widget.AdapterView.performItemClick(AdapterView.java:310)
      1 frame