android 启动应用程序时出现奇怪的错误
我在启动应用程序时收到此错误,并且我已检查清单文件和活动是否存在。 Rathbones 是主要活动。
10-19 13:27:14.796: ERROR/AndroidRuntime(441): FATAL EXCEPTION: main
10-19 13:27:14.796: ERROR/AndroidRuntime(441): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.rathbones.src/com.rathbones.src.RathbonesActivity}: java.lang.InstantiationException: com.rathbones.src.RathbonesActivity
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1739)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.access$500(ActivityThread.java:122)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.os.Handler.dispatchMessage(Handler.java:99)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.os.Looper.loop(Looper.java:132)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.main(ActivityThread.java:4123)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.reflect.Method.invokeNative(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.reflect.Method.invoke(Method.java:491)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at dalvik.system.NativeStart.main(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): Caused by: java.lang.InstantiationException: com.rathbones.src.RathbonesActivity
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.Class.newInstanceImpl(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.Class.newInstance(Class.java:1301)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1730)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): ... 11 more
10-19 13:27:14.806: WARN/ActivityManager(78): Force finishing activity com.rathbones.src/.RathbonesActivity
I am getting this error while launching the app, and I have checked the manifest file and the activities are there. Rathbones is the main activity.
10-19 13:27:14.796: ERROR/AndroidRuntime(441): FATAL EXCEPTION: main
10-19 13:27:14.796: ERROR/AndroidRuntime(441): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.rathbones.src/com.rathbones.src.RathbonesActivity}: java.lang.InstantiationException: com.rathbones.src.RathbonesActivity
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1739)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.access$500(ActivityThread.java:122)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.os.Handler.dispatchMessage(Handler.java:99)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.os.Looper.loop(Looper.java:132)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.main(ActivityThread.java:4123)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.reflect.Method.invokeNative(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.reflect.Method.invoke(Method.java:491)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at dalvik.system.NativeStart.main(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): Caused by: java.lang.InstantiationException: com.rathbones.src.RathbonesActivity
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.Class.newInstanceImpl(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.Class.newInstance(Class.java:1301)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1730)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): ... 11 more
10-19 13:27:14.806: WARN/ActivityManager(78): Force finishing activity com.rathbones.src/.RathbonesActivity
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查
.RathbonesActivity
活动是否在您的主包中,例如com.activity.RathbonesActivity
或确保在清单中的活动声明中将完整路径写入
com.packagename .RathbonesActivity
检查这个StackOverflow问题了解“.”是什么意思。点的含义以及如何使用它。
check if the
.RathbonesActivity
activity is in your main package saycom.activity.RathbonesActivity
or to be sure write full path in activity declaration in manifest as
com.packagename.RathbonesActivity
check this StackOverflow Question to understand what the "." dot means and how to use it.