当我尝试导航时我的应用程序崩溃,似乎找不到问题

My app crashes when I try to navigate, can't seem to find issue

我似乎找不到我的应用程序有什么问题... 这是 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) 

知道应用程序崩溃的原因吗?

这一行就是问题所在

Caused by: java.lang.ClassCastException: android.support.design.widget.TextInputEditText cannot be cast to android.support.design.widget.TextInputLayout

检查声明的类型是否与布局文件中的匹配

您的转换似乎有误:java.lang.ClassCastException:android.support.design.widget.TextInputEditText 无法转换为 android.support.design.widget.TextInputLayout

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

私有 TextInputEditText inputEmail, inputPass;

inputEmail = (TextInputEditText) findViewById(R.id.input_log_email); inputPass = (TextInputEditText) findViewById(R.id.input_log_pass);