Method.invoke() has thrown a NullPointerException

java.lang.NullPointerException
Javadoc
Thrown when an application attempts to use {@code null} in a case where an object is required. These include:
  • Calling the instance method of a {@code null} object.
  • Accessing or modifying the field of a {@code null} object.
  • Taking the length of {@code null} as if it were an array.
  • Accessing or modifying the slots of {@code null} as if it were an array.
  • Throwing {@code null} as if it were a {@code Throwable} value.

Applications should throw instances of this class to indicate other illegal uses of the {@code null} object. {@code NullPointerException} objects may be constructed by the virtual machine as if {@linkplain Throwable#Throwable(String, Throwable, boolean, boolean) suppression were disabled and/or the stack trace was not writable}. @author unascribed @since JDK1.0

at android.view.View.performClick
(source)
at android.view.View$PerformClick.run
(source)
at android.os.Handler.handleCallback
(source)
at android.os.Handler.dispatchMessage
(source)
at android.os.Looper.loop
(source)
at android.app.ActivityThread.main
(source)
at java.lang.reflect.Method.invoke
(source)
6 frames hidden

Typical Exception Messages

  1. Attempt to invoke virtual method 'java.lang.String android.view.View.toString()' on a null object reference at com.example.casa.gasquefabaixada.MainActivity$1.onClick(MainActivity.java:94)
  2. Attempt to read from field 'long o.Ԇ.ˉ' on a null object reference at o.ɻ.ˊ(:17320) at o.モ.ˊ(:5334) at o.Ĵ.ˊ(:521) at o.ت$36.onClick(:2480)
  3. Attempt to invoke virtual method 'void --.----------.-------.AjastinAdapter.notifyDataSetChanged()' on a null object reference at --.----------.-------.MainActivityTimerList$override.addNewTime(MainActivityTimerList.java:83) at --.----------.-------.MainActivityTimerList$override.access$dispatch(MainActivityTimerList.java) at --.----------.-------.MainActivityTimerList.addNewTime(MainActivityTimerList.java:0) at --.----------.-------.MainActivity.onClick(MainActivity.java:131)
  4. Attempt to invoke virtual method 'void friendlocator.project.cozycodes.friendlocator.Fragment.SearchFragment.addFriend(java.lang.String)' on a null object reference atfriendlocator.project.cozycodes.friendlocator.Adapter.SearchAdapter$1.onClick(SearchAdapter.java:96)
  5. Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at com.bigkoo.pickerview.lib.WheelView.void measureTextWidthHeight()(SourceFile:250) at com.bigkoo.pickerview.lib.WheelView.void remeasure()(SourceFile:217) at com.bigkoo.pickerview.lib.WheelView.void setAdapter(com.bigkoo.pickerview.adapter.WheelAdapter)(SourceFile:328) at com.bigkoo.pickerview.view.WheelOptions.void setPicker(java.util.List,java.util.List,java.util.List)(SourceFile:68) at com.bigkoo.pickerview.OptionsPickerView.void setPicker(java.util.List,java.util.List,java.util.List)(SourceFile:522) at com.hulixuehui.app.ui.login.RegisterActivity.void selectCity(java.util.List,java.util.List,java.util.List)(SourceFile:101) at com.hulixuehui.app.ui.login.RegisterViewModel.void selectCity(android.view.View)(SourceFile:129) at com.hulixuehui.app.databinding.ActivityRegisterBinding$OnClickListenerImpl.void onClick(android.view.View)(SourceFile:694)
  6. Attempt to invoke virtual method 'java.lang.String com.teamsite.android.calendar.g.e.e()' on a null object reference at com.teamsite.android.calendar.sync.PushHelper.void setup(android.content.Context,android.support.v7.app.AppCompatActivity,com.teamsite.android.calendar.objects.Calendar,android.app.ProgressDialog,int)(SourceFile:30) at com.teamsite.android.calendar.wizard.addcalendar.activities.SelectSyncOptionsWizard$1.void onClick(android.view.View)(SourceFile:112)
  7. Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference at com.example..mainbuchhaltung.Mitglieder.MitgliederMainActivity.onMitgliederClick(MitgliederMainActivity.java:83) at com.example..mainbuchhaltung.Mitglieder.MitgliederListAdapter$MitgliederViewHolder$1.onClick(MitgliederListAdapter.java:86)

Origin

View.performClick() has thrown a NullPointerException

java.lang.NullPointerException
android.view.View.performClick
8Web pages

Similar

Specific cases

External results for this pattern (6)

  1. LordGashvia Stack Overflow3 months ago
    Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference at com.example..mainbuchhaltung.Mitglieder.MitgliederMainActivity.onMitgliederClick(MitgliederMainActivity.java:83) at com.example..mainbuchhaltung.Mitglieder.MitgliederListAdapter$MitgliederViewHolder$1.onClick(MitgliederListAdapter.java:86)
    Show stack trace
  2. blueleader07via GitHub4 months ago
    Attempt to invoke virtual method 'java.lang.String com.teamsite.android.calendar.g.e.e()' on a null object reference at com.teamsite.android.calendar.sync.PushHelper.void setup(android.content.Context,android.support.v7.app.AppCompatActivity,com.teamsite.android.calendar.objects.Calendar,android.app.ProgressDialog,int)(SourceFile:30) at com.teamsite.android.calendar.wizard.addcalendar.activities.SelectSyncOptionsWizard$1.void onClick(android.view.View)(SourceFile:112)
    Show stack trace
  3. XuQKvia GitHub8 months ago
    Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at com.bigkoo.pickerview.lib.WheelView.void measureTextWidthHeight()(SourceFile:250) at com.bigkoo.pickerview.lib.WheelView.void remeasure()(SourceFile:217) at com.bigkoo.pickerview.lib.WheelView.void setAdapter(com.bigkoo.pickerview.adapter.WheelAdapter)(SourceFile:328) at com.bigkoo.pickerview.view.WheelOptions.void setPicker(java.util.List,java.util.List,java.util.List)(SourceFile:68) at com.bigkoo.pickerview.OptionsPickerView.void setPicker(java.util.List,java.util.List,java.util.List)(SourceFile:522) at com.hulixuehui.app.ui.login.RegisterActivity.void selectCity(java.util.List,java.util.List,java.util.List)(SourceFile:101) at com.hulixuehui.app.ui.login.RegisterViewModel.void selectCity(android.view.View)(SourceFile:129) at com.hulixuehui.app.databinding.ActivityRegisterBinding$OnClickListenerImpl.void onClick(android.view.View)(SourceFile:694)
    Show stack trace
  4. Attempt to invoke virtual method 'void friendlocator.project.cozycodes.friendlocator.Fragment.SearchFragment.addFriend(java.lang.String)' on a null object reference atfriendlocator.project.cozycodes.friendlocator.Adapter.SearchAdapter$1.onClick(SearchAdapter.java:96)
    Show stack trace
  5. Nuublesvia Stack Overflow1 year ago
    Attempt to invoke virtual method 'void --.----------.-------.AjastinAdapter.notifyDataSetChanged()' on a null object reference at --.----------.-------.MainActivityTimerList$override.addNewTime(MainActivityTimerList.java:83) at --.----------.-------.MainActivityTimerList$override.access$dispatch(MainActivityTimerList.java) at --.----------.-------.MainActivityTimerList.addNewTime(MainActivityTimerList.java:0) at --.----------.-------.MainActivity.onClick(MainActivity.java:131)
    Show stack trace
  6. Attempt to invoke virtual method 'java.lang.String android.view.View.toString()' on a null object reference at com.example.casa.gasquefabaixada.MainActivity$1.onClick(MainActivity.java:94)
    Show stack trace