java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{engineering.aspire.simpletodo/engineering.aspire.simpletodo.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

Samebug tips

,

Create an empty public constructor in your code.

Solutions on the web

via GitHub by thomasphillips3
, 1 year ago
Unable to instantiate activity ComponentInfo{engineering.aspire.simpletodo/engineering.aspire.simpletodo.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 Andrew Takao
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.andrewtakao.testapp/com.example.andrewtakao.testapp.ListViewActivity}: 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 Neil Ruggiero
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.neil.bsgquiz/com.example.neil.bsgquiz.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 Mirwise Khan
, 1 year ago
Unable to instantiate activity ComponentInfo{com.cruzerblade.memorygame/com.cruzerblade.memorygame.GameActivity}: 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 Joe Doe
, 9 months ago
Unable to instantiate activity ComponentInfo{myapp.onur.journeygpacalculator/myapp.onur.journeygpacalculator.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 Deep Harquissandas
, 3 months ago
Unable to instantiate activity ComponentInfo{com.dharquissandas.budget/com.dharquissandas.budget.add_expense}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{engineering.aspire.simpletodo/engineering.aspire.simpletodo.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)

Users with the same issue

66 times, 3 weeks ago
Once, 2 months ago
33 times, 3 months ago
8 times, 3 months ago
468 times, 4 months ago

Write tip

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