java.lang.IllegalStateException

Could not execute method for android:onClick

Solutions on the web19618

  • via GitHub by svalo
    , 1 year ago
    Could not execute method for android:onClick
  • via GitHub by btusca
    , 1 year ago
    Could not execute method for android:onClick
  • via GitHub by ascoril
    , 8 months ago
    Could not execute method for android:onClick
  • Stack trace

    • 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:4191) at android.view.View$PerformClick.run(View.java:17229) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4960) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) 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:511) at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288) ... 11 more Caused by: java.lang.NullPointerException: file at android.net.Uri.fromFile(Uri.java:441) at com.example.a3spl.camera.MainActivity.takePicture(MainActivity.java:82) ... 14 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    348 times, 1 year ago
    Once, 1 year ago
    2 times, 1 year ago
    Once, 1 year ago
    Unknown user
    Once, 1 week ago