java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.salimshivani.student/com.example.salimshivani.student.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Salim Shivani
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.salimshivani.student/com.example.salimshivani.student.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via codegur.com by Unknown author, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.salimshivani.student/com.example.salimshivani.student.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via Stack Overflow by Susano Joon
, 10 months ago
Unable to instantiate activity ComponentInfo{ir.pluto.mediaplayer/ir.pluto.mediaplayer.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via Stack Overflow by Vaugito
, 6 months ago
Unable to instantiate activity ComponentInfo{com.vaughnx.vaugi.soundwall/com.vaughnx.vaugi.soundwall.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via Stack Overflow by Jvalant Dave
, 1 year ago
Unable to instantiate activity ComponentInfo{com.directv.application.android.go.production/com.morega.qew.ui.streaming.ExoStreamingPlaybackScreen}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.PackageManager android.content.Context.getPackageManager()' on a null object reference
via Stack Overflow by Julian
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.android.stimmenauswerter/com.example.android.stimmenauswerter.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.content.ContextWrapper.getResources(ContextWrapper.java:92)
at android.view.ContextThemeWrapper.getResources(ContextThemeWrapper.java:81)
at com.example.salimshivani.student.MainActivity.(MainActivity.java:241)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1096)

Users with the same issue

5 times, 1 year ago
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.