java.lang.IllegalStateException: Could not execute method for android:onClick

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

,

You try to parse a String that contains non-numeric characters to an int. The string must contain decimal characters only, optionally beginning with a + or - sign.

java.lang.IllegalStateException: Could not execute method for android:onClick
at java.lang.Integer.invalidInt(Integer.java:137)
at java.lang.Integer.parseInt(Integer.java:358)
at java.lang.Integer.parseInt(Integer.java:331)
at com.logixor.advancedcalc.MainActivity.calc(MainActivity.java:30)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.view.View.performClick(View.java:4640)
at android.view.View$PerformClick.run(View.java:19425)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5593)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)

Users with the same issue

852 times, 1 month ago
6 times, 4 months ago
2 times, 10 months ago
3 times, 1 year ago
15 times, 1 year ago

Write tip

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