背景信息:
我一直用Android应用程序帮助我的一个朋友。他有一些承包商建造的应用程序不是很有帮助。我告诉他我会帮助他。
上周,应用程序突然崩溃了。
我在Android 6.0设备上的Android Studio 2.1.3中运行此功能。
如果我尝试注册,我会:
Unfortunately, myapp has stopped working.
如果我尝试登录,我会:
Invalid Parameters
Please check the values entered and try again. Email and password cannot be blank.
我已经尝试过调试,但我不是Android专业人士。我最接近的是看到pushToken的长度为0.我真的不知道这是否意味着什么。
我不确定您是否需要整个登录类,如果是,请提出请求。我想知道这可能只是简单的事情或与最新的Android更新有关。
以下是错误:
10-07 23:46:19.440 17304-17304/com.myapp.myapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp.myapp, PID: 17304
java.lang.IllegalStateException: Could not execute method for android:onClick
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)
at android.view.View.performClick(View.java:5201)
at android.view.View$PerformClick.run(View.java:21163)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
at android.view.View.performClick(View.java:5201)
at android.view.View$PerformClick.run(View.java:21163)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myapp.myapp/com.myapp.myapp.Register}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1885)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1579)
at android.app.Activity.startActivityForResult(Activity.java:3921)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75)
at android.app.Activity.startActivityForResult(Activity.java:3881)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:871)
at android.app.Activity.startActivity(Activity.java:4208)
at android.app.Activity.startActivity(Activity.java:4176)
at com.myapp.myapp.Login.signUp(Login.java:106)
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
at android.view.View.performClick(View.java:5201)
at android.view.View$PerformClick.run(View.java:21163)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
10-07 23:51:13.879 18211-18211/com.myapp.myapp E/linker: readlink('') failed: No such file or directory [fd=20]
10-07 23:51:13.879 18211-18211/com.myapp.myapp E/linker: warning: unable to get realpath for the library "/data/app/com.myapp.myapp-2/oat/arm64/base.odex". Will use given name.
答案 0 :(得分:1)
崩溃的问题和解决方案都在错误跟踪中:
引起:android.content.ActivityNotFoundException:无法找到 显式活动类{com.myapp.myapp / com.myapp.myapp.Register}; 你有没有在AndroidManifest.xml中声明这个活动?
打开您的AndroidManifest.xml
文件,确保其中有类似内容:
<activity android:name="com.myapp.myapp.Register">
</activity>