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

Stack Overflow | Laurent Duthoo | 3 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Java Tic tac toe AI element not working

    Stack Overflow | 1 year ago | Rich C
    java.lang.IllegalStateException: Could not execute method for android:onClick
  2. 0

    Looping through 'tablelayout' to return specific button tag

    Stack Overflow | 1 year ago | Rich C
    java.lang.IllegalStateException: Could not execute method for android:onClick
  3. 0

    App crashing when sending pending intent Alarm Manager

    Stack Overflow | 7 months ago | Superdsg
    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:4438) at android.view.View$PerformClick.run(View.java:18422) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) 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:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288) at android.view.View.performClick(View.java:4438)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Unfortunately android has stopped working when the app is run on genymotion emulator

    Stack Overflow | 10 months ago | Adi_Kat
    java.lang.IllegalStateException: Could not execute method for android:onClick at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:275) at android.view.View.performClick(View.java:4438) at android.view.View$PerformClick.run(View.java:18422) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5001) 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:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:270) at android.view.View.performClick(View.java:4438)
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. android.os.NetworkOnMainThreadException

    No message provided

    at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork()
  2. Android Platform
    StrictMode$AndroidBlockGuardPolicy.onNetwork
    1. android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1147)
    1 frame
  3. Android
    IoBridge.connect
    1. libcore.io.BlockGuardOs.connect(BlockGuardOs.java:110)
    2. libcore.io.IoBridge.connectErrno(IoBridge.java:137)
    3. libcore.io.IoBridge.connect(IoBridge.java:122)
    3 frames
  4. Java RT
    Socket.connect
    1. java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
    2. java.net.PlainSocketImpl.connect(PlainSocketImpl.java:456)
    3. java.net.Socket.connect(Socket.java:882)
    3 frames
  5. Android
    HttpURLConnectionImpl.getOutputStream
    1. com.android.okhttp.internal.Platform.connectSocket(Platform.java:139)
    2. com.android.okhttp.Connection.connect(Connection.java:1171)
    3. com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:380)
    4. com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:289)
    5. com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:373)
    6. com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
    7. com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:208)
    7 frames
  6. net.tchouny.httppost
    MainActivity.httpPost
    1. net.tchouny.httppost.MainActivity.httpPost(MainActivity.java:48)
    1 frame
  7. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  8. Android v7
    AppCompatViewInflater$DeclaredOnClickListener.onClick
    1. android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
    1 frame
  9. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:5156)
    2. android.view.View$PerformClick.run(View.java:20755)
    3. android.os.Handler.handleCallback(Handler.java:739)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:145)
    6. android.app.ActivityThread.main(ActivityThread.java:5832)
    6 frames
  10. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  11. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
    2 frames