Justin Justin - 2 months ago 21
Android Question

Application all of a sudden crashing

Background Info:

I have been helping a friend of mine with an Android Application. He had the app built by some contractors who weren't very helpful. I told him I would help him out.

All of a sudden last week the app started crashing.

I am running this in Android Studio 2.1.3 on a Android 6.0 device.

If I try to Sign Up I get:

Unfortunately, myapp has stopped working.


If I try to Login I get:

Invalid Parameters
Please check the values entered and try again. Email and password cannot be blank.


I have tried debugging, however I am no Android professional. The closest I've come to is seeing that the pushToken has a length of 0. I don't really know if that means anything.

I'm not sure if you will need the entire Login class or not, if so please request it. I'm wondering if this is maybe just something simple or something to do with the newest Android updated.

Here is the error:

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.

Answer

The problem and the solution for the crash are both in the error trace:

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?

Open your AndroidManifest.xml file and make sure there's something like this in there:

    <activity android:name="com.myapp.myapp.Register">
    </activity>