java.lang.RuntimeException: Unable to start activity ComponentInfo{co5025.example.com.week10/co5025.example.com.week10.MainActivity}: java.lang.ClassCastException: android.support.v7.widget.AppCompatEditText cannot be cast to android.widget.Button

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 Stack Overflow by 1621656
, 10 months ago
Unable to start activity ComponentInfo{co5025.example.com.week10/co5025.example.com.week10.MainActivity}: java.lang.ClassCastException: android.support.v7.widget.AppCompatEditText cannot be cast to android.widget.Button
via Stack Overflow by Muhammad Bilal
, 4 months ago
Unable to start activity ComponentInfo{com.example.user.alert_dialog/com.example.user.alert_dialog.MainActivity}: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.Button
via Stack Overflow by hamster
, 11 months ago
Unable to instantiate activity ComponentInfo{com.example.adi.fragment2/com.example.adi.fragment2.MainActivity}: java.lang.ClassCastException: com.example.adi.fragment2.MainActivity cannot be cast to android.app.Activity
via GitHub by xtj-9182
, 1 year ago
Unable to start activity ComponentInfo{ar.rulosoft.mimanganu/ar.rulosoft.mimanganu.MainActivity}: java.lang.ClassCastException: android.support.v7.preference.PreferenceScreen cannot be cast to android.preference.GenericInflater$Parent
via GitHub by TheWorstNL
, 1 year ago
Unable to start activity ComponentInfo{me.ccrama.redditslide.debug/me.ccrama.redditslide.Activities.MainActivity}: java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to me.ccrama.redditslide.SpoilerRobotoTextView
via Stack Overflow by shivi shah
, 10 months ago
Unable to start activity ComponentInfo{com.example.vicky.project/com.example.vicky.project.MainActivity}: java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to android.widget.EditText
java.lang.RuntimeException: Unable to start activity ComponentInfo{co5025.example.com.week10/co5025.example.com.week10.MainActivity}: java.lang.ClassCastException: android.support.v7.widget.AppCompatEditText cannot be cast to android.widget.Button
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)

Users with the same issue

Once, 1 month ago
33 times, 2 months ago
8 times, 2 months ago
468 times, 3 months ago
65 times, 5 months ago

Write tip

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