0

As mentioned in the title, when compiling, the Console says: Failed to install ap.apk

But the logcat shows this:

    02-21 00:45:25.052: W/dalvikvm(921): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
    02-21 00:45:25.272: E/AndroidRuntime(921): FATAL EXCEPTION: main
    02-21 00:45:25.272: E/AndroidRuntime(921): java.lang.IllegalStateException: Could not find a method retour(View) in the activity class hd.android.contact.ContactActionActivity for onClick handler on view class android.widget.Button with id 'button5'
    02-21 00:45:25.272: E/AndroidRuntime(921):  at android.view.View$1.onClick(View.java:3031)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at android.view.View.performClick(View.java:3511)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at android.view.View$PerformClick.run(View.java:14105)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at android.os.Handler.handleCallback(Handler.java:605)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at android.os.Handler.dispatchMessage(Handler.java:92)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at android.os.Looper.loop(Looper.java:137)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at android.app.ActivityThread.main(ActivityThread.java:4424)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at java.lang.reflect.Method.invokeNative(Native Method)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at java.lang.reflect.Method.invoke(Method.java:511)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at dalvik.system.NativeStart.main(Native Method)
    **02-21 00:45:25.272: E/AndroidRuntime(921): Caused by: java.lang.NoSuchMethodException: retour [class android.view.View]**
    02-21 00:45:25.272: E/AndroidRuntime(921):  at java.lang.Class.getConstructorOrMethod(Class.java:460)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at java.lang.Class.getMethod(Class.java:915)
    02-21 00:45:25.272: E/AndroidRuntime(921):  at android.view.View$1.onClick(View.java:3024)

I commented all my "retour" methods and deleted all android:onClick related to this method, and it did not help...Everything was working fine before...

Can anybody help please?

Thank you in advance

Yury
  • 19,498
  • 7
  • 52
  • 79
Hosni
  • 658
  • 8
  • 29
  • Please, add the code of your activity. – Yury Feb 21 '12 at 19:33
  • problem solved, the code wasn't correctly sent to the AVM. Noticed it when i closed the current AVM and started another one: The app' did not run and each time i tried to run it again, it started a new AVM window. So i restarted adb.exe and it worked. – Hosni Feb 21 '12 at 19:36

1 Answers1

2
IllegalStateException: Could not find a method retour(View)

I think the problem is that you (definitely) have specified onClick on a method retour in the XML but the method is not present in the Java code.

If the problem continues, try cleaning the project and shutting down your softphone.

Peter O.
  • 28,965
  • 14
  • 72
  • 87