java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.admin.test_purpose/com.example.admin.test_purpose.MainActivity}: java.lang.NullPointerException

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 Nilesh Indalkar
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.admin.test_purpose/com.example.admin.test_purpose.MainActivity}: java.lang.NullPointerException
via GitHub by jeetdholakia
, 2 years ago
Unable to instantiate activity ComponentInfo{com.example.drawtextsample/com.android.camera.CropImage}: java.lang.NullPointerException
via Stack Overflow by Conrad
, 2 years ago
Unable to instantiate activity ComponentInfo{android.reader/android.reader.Reader}: java.lang.NullPointerException
via Stack Overflow by xlk3099
, 2 years ago
Unable to instantiate activity ComponentInfo{com.example.uitest/com.example.uitest.MainActivity}: java.lang.NullPointerException
via Stack Overflow by Rasam
, 2 years ago
Unable to instantiate activity ComponentInfo{com.rasam.sampleproject/com.rasam.sampleproject.MainActivity}: java.lang.NullPointerException
via Stack Overflow by user2236096
, 2 years ago
Unable to instantiate activity ComponentInfo{com.hychentsa.calculator_v001/com.hychentsa.calculator_v001.Calculator_v001_Activity}: java.lang.NullPointerException
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.admin.test_purpose/com.example.admin.test_purpose.MainActivity}: java.lang.NullPointerException
at android.app.Activity.findViewById(Activity.java:1825)
at com.example.admin.test_purpose.MainActivity.(MainActivity.java:15)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1053)

Users with the same issue

3 times, 1 year ago
818 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
1 more bugmates

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