Caused by: java.lang.NoSuchMethodException:

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime: FATAL EXCEPTION: main

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime: Process: com.zaizai.safty, PID: 27343

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime: java.lang.IllegalStateException: Could not find a method onClike(View) in the activity class android.view.ContextThemeWrapper for onClick handler on view class android.widget.Button

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View$1.onClick(View.java:4043)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View.performClick(View.java:4811)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:20136)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:815)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:104)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:194)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5546)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:  Caused by: java.lang.NoSuchMethodException: onClike [class android.view.View]

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.Class.getMethod(Class.java:664)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.Class.getMethod(Class.java:643)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View$1.onClick(View.java:4036)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View.performClick(View.java:4811)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:20136)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:815)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:104)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:194)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5546)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)

经过百度,google终于解决了

在布局文件中不能使用

android:theme="@style/AppTheme.NoActionBar"

去掉即可

时间: 2024-11-14 04:30:09

Caused by: java.lang.NoSuchMethodException:的相关文章

Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android

?? 在写自己定义的view时,有时会报下面错误: Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet] <view android:id="@id/viewpage_container" android:layout_width="fill_parent" and

Caused by: java.lang.NoSuchMethodException: &lt;init&gt; [class android.content.Context, interface androi

报错提示代码: Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet] 1.报错原因: 在自定义view时,没有重写含有(Context context,AttributeSet attrs)的构造器 解决办法: 重新对于构造器,例如: public ControlKeyboardLinearLayout(Con

Caused by: java.lang.NoSuchMethodException: &lt;init&gt; [class android.content.Context, interface android

 在写自定义的view时,有时会报以下错误: Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet] <view android:id="@id/viewpage_container" android:layout_width="fill_parent" andr

Caused by: java.lang.NoSuchMethodException: onClick_Flashlight [class android.view.View]

原因:方法的参数忘了写: public void onClick_ToFlashlight(){} ----> public void onClick_ToFlashlight(View view){} 原因:方法的访问权限问题: private void onClick_Controller(View view) {}----> public void onClick_Controller(View view) {} 原因:方法名的大小写有误与XML文件不对应: public void on

解决Caused by: java.lang.NoSuchMethodException: com.mchange.v2.c3p0.cfg.C3P0Config.&lt;init&gt;()的总结

引起:spring的dao层注入dataSource出现c3p0初始化异常. bug示图: 源码图: 解决: 在填写property属性时,我就纳闷alt+/用不了了,完了之后运行发现初始化出错,然后一看,是因为class引入的类有问题 引入错误的类:com.mchange.v2.c3p0.cfg.C3P0Config 正确的类:com.mchange.v2.c3p0.ComboPooledDataSource

java 使用反射创建对象时异常 InstantiationException: Caused by: java.lang.NoSuchMethodException:

|--异常现象 |--异常原因 需要实例化的类的无参方法被有参方法覆盖之后,导致无法创建对象 |--改正方法 给对应的类创建一个无参构造方法 |--改正后效果 原文地址:https://www.cnblogs.com/twuxian/p/11620138.html

java.lang.NoSuchMethodException: [class android.view.View]

05-24 11:38:35.884: E/AndroidRuntime(1819): FATAL EXCEPTION: main05-24 11:38:35.884: E/AndroidRuntime(1819): Process: com.example.activitytest, PID: 181905-24 11:38:35.884: E/AndroidRuntime(1819): java.lang.IllegalStateException: Could not find a met

Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity

1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-12 19:41:17 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 usi

MyBatis3.4.0以上的分页插件错误:Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.stateme

错误: Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)] with root cause 问题