android 启动应用程序时出现奇怪的错误

发布于 2024-12-11 02:20:34 字数 2517 浏览 1 评论 0原文

我在启动应用程序时收到此错误,并且我已检查清单文件和活动是否存在。 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

守望孤独 2024-12-18 02:20:34

检查 .RathbonesActivity 活动是否在您的主包中,例如 com.activity.RathbonesActivity

或确保在清单中的活动声明中将完整路径写入 com.packagename .RathbonesActivity

检查这个StackOverflow问题了解“.”是什么意思。点的含义以及如何使用它。

check if the .RathbonesActivity activity is in your main package say com.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文