当我尝试导航时,我的应用程序崩溃了,似乎找不到问题 [英] My app crashes when I try to navigate, can't seem to find issue

查看:71
本文介绍了当我尝试导航时,我的应用程序崩溃了,似乎找不到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎找不到我的应用程序有什么问题...这是logcat:

I can't seem to find whats wrong with my application... Here is the logcat:

11-05 16:37:30.030 7867-7867/com.capstone.miguel.studentassistant E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                Process: com.capstone.miguel.studentassistant, PID: 7867
                                                                                java.lang.RuntimeException: Unable to start activity ComponentInfo{com.capstone.miguel.studentassistant/com.capstone.miguel.studentassistant.user_sign.LoginActivity}: java.lang.ClassCastException: android.support.design.widget.TextInputEditText cannot be cast to android.support.design.widget.TextInputLayout
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                                    at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                    at android.os.Looper.loop(Looper.java:154)
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                                                                                 Caused by: java.lang.ClassCastException: android.support.design.widget.TextInputEditText cannot be cast to android.support.design.widget.TextInputLayout
                                                                                    at com.capstone.miguel.studentassistant.user_sign.LoginActivity.onCreate(LoginActivity.java:34)
                                                                                    at android.app.Activity.performCreate(Activity.java:6679)
                                                                                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
                                                                                    at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                    at android.os.Looper.loop(Looper.java:154) 
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:6119) 
                                                                                    at java.lang.reflect.Method.invoke(Native Method) 
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

知道为什么应用程序崩溃了吗?

Any idea why the application crashes?

推荐答案

看起来您的转换错误:java.lang.ClassCastException:android.support.design.widget.TextInputEditText无法转换为android.support.design.widget.TextInputLayout

It looks like you have wrong casting: java.lang.ClassCastException: android.support.design.widget.TextInputEditText cannot be cast to android.support.design.widget.TextInputLayout

检查在xml和代码中是否使用相同的类型,可能它们是不同的.

Check if you use the same types in xml and in your code, probably they are different.

这篇关于当我尝试导航时,我的应用程序崩溃了,似乎找不到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆