java.lang.IllegalAccessException: access to class not allowed 错误解决方法
来源:互联网 发布:阿里云服务器能转让吗 编辑:程序博客网 时间:2024/05/31 19:50
06-27 04:48:02.123: ERROR/AndroidRuntime(787): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{net.android.surfacetest/net.android.surfacetest.MainActivity}: java.lang.IllegalAccessException: access to class not allowed
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.os.Handler.dispatchMessage(Handler.java:99)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.os.Looper.loop(Looper.java:123)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at java.lang.reflect.Method.invokeNative(Native Method)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at java.lang.reflect.Method.invoke(Method.java:507)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at dalvik.system.NativeStart.main(Native Method)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): Caused by: java.lang.IllegalAccessException: access to class not allowed
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at java.lang.Class.newInstanceImpl(Native Method)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at java.lang.Class.newInstance(Class.java:1409)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-27 04:48:02.123: ERROR/AndroidRuntime(787): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
-----------------------------------
以上是错误日志信息
我的错误是写class 文件是时候没有把class设置成public
我把原来的class MainActivity 改成 public classMainActivity
在重新运行就可以了
- java.lang.IllegalAccessException: access to class not allowed 错误解决方法
- java.lang.IllegalAccessException: access to class not allowed 错误解决方法
- java.lang.IllegalAccessException: access to class not allowed 错误解决方法
- java.lang.IllegalAccessException: access to class not allowed 错误解决方法
- Android报java.lang.IllegalAccessException: access to class not allowed错误
- Caused by: java.lang.IllegalAccessException: Class ognl.OgnlRuntime can not access a member of class
- java.lang.IllegalAccessException: Class javax.el.BeanELResolver can not access a member of class...
- Caused by: java.lang.IllegalAccessException: Class ognl.OgnlRuntime can not access a member of class
- struts2--java.lang.IllegalAccessException: Class ognl.OgnlRuntime can not access a member of...问题解决方案
- 运行Android项目,报错java.lang.IllegalAccessException: access to constructor not allowe
- 运行Android项目,报错java.lang.IllegalAccessException: access to constructor not allowe
- Android-广播 BroadcastReceiver-java.lang.IllegalAccessException: access to constructor not allowe
- java.lang.IllegalAccessException:Class org.apache.axis.providers.java.JavaProvider can not access a member of class MyMath with
- android BroadcastReceiver遇到 java.lang.IllegalAccessException解决方法
- ubuntu( not allowed to access the system configuration)解决方法
- pointer to incomplete class type is not allowed是什么错误?
- pointer to incomplete class type is not allowed 错误
- java.lang.IllegalAccessException翻译
- Regexp
- TC SRM 519 600pt
- Altium Designer学习
- ORA-16038
- arm与51单片机之间串口通信实验
- java.lang.IllegalAccessException: access to class not allowed 错误解决方法
- Animation动画效果(代码实现)
- 初学STL——map
- Android JSON字符串解析和构建
- C语言复制字符串
- sizeof(struct var) 的长度如何计算
- 写宏定义:得到一个field在结构体(struct type)中的偏移量[转]
- 头文件包含
- HDU 4260 The End of The World(汉罗塔)