Android apk未能安装&;logcat显示NoSuchMethodException
正如标题中提到的,编译时,控制台会说:Android apk未能安装&;logcat显示NoSuchMethodException,android,onclick,nosuchmethoderror,nosuchmethod,Android,Onclick,Nosuchmethoderror,Nosuchmethod,正如标题中提到的,编译时,控制台会说:未能安装ap.apk 但logcat显示: 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/And
未能安装ap.apk
但logcat显示:
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)
我评论了我所有的“retour”方法,删除了所有与此方法相关的android:onClick,但没有任何帮助…之前一切都很好
有人能帮忙吗
先谢谢你
IllegalStateException: Could not find a method retour(View)
我认为问题在于您(肯定)在XML中的方法retour
上指定了onClick
,但是
在Java代码中不存在
如果问题仍然存在,请尝试清理项目并关闭软电话。请添加活动的代码。问题已解决,代码未正确发送到AVM。当我关闭当前AVM并启动另一个AVM时注意到:应用程序“没有运行,每次我尝试再次运行它时,它都会启动一个新的AVM窗口。所以我重新启动了adb.exe,它成功了。