gpt4 book ai didi

android - Android应用程式在开启时当机

转载 作者:行者123 更新时间:2023-12-03 16:19:21 26 4
gpt4 key购买 nike

我正在开发一个android应用程序,打开AVD并解锁设备并单击菜单后,出现“应用程序意外停止”错误。以下是我的logcat日志。

02-22 11:34:38.220: D/AndroidRuntime(336): Shutting down VM
02-22 11:34:38.220: W/dalvikvm(336): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-22 11:34:38.290: E/AndroidRuntime(336): FATAL EXCEPTION: main
02-22 11:34:38.290: E/AndroidRuntime(336): java.lang.RuntimeException: Unable to instantiate application com.compliment.ComplimentGenerator: java.lang.ClassCastException: com.compliment.ComplimentGenerator
02-22 11:34:38.290: E/AndroidRuntime(336): at android.app.LoadedApk.makeApplication(LoadedApk.java:466)
02-22 11:34:38.290: E/AndroidRuntime(336): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3260)
02-22 11:34:38.290: E/AndroidRuntime(336): at android.app.ActivityThread.access$2200(ActivityThread.java:117)
02-22 11:34:38.290: E/AndroidRuntime(336): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969)
02-22 11:34:38.290: E/AndroidRuntime(336): at android.os.Handler.dispatchMessage(Handler.java:99)
02-22 11:34:38.290: E/AndroidRuntime(336): at android.os.Looper.loop(Looper.java:123)
02-22 11:34:38.290: E/AndroidRuntime(336): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-22 11:34:38.290: E/AndroidRuntime(336): at java.lang.reflect.Method.invokeNative(Native Method)
02-22 11:34:38.290: E/AndroidRuntime(336): at java.lang.reflect.Method.invoke(Method.java:507)
02-22 11:34:38.290: E/AndroidRuntime(336): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-22 11:34:38.290: E/AndroidRuntime(336): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-22 11:34:38.290: E/AndroidRuntime(336): at dalvik.system.NativeStart.main(Native Method)
02-22 11:34:38.290: E/AndroidRuntime(336): Caused by: java.lang.ClassCastException: com.compliment.ComplimentGenerator
02-22 11:34:38.290: E/AndroidRuntime(336): at android.app.Instrumentation.newApplication(Instrumentation.java:957)
02-22 11:34:38.290: E/AndroidRuntime(336): at android.app.Instrumentation.newApplication(Instrumentation.java:942)
02-22 11:34:38.290: E/AndroidRuntime(336): at android.app.LoadedApk.makeApplication(LoadedApk.java:461)
02-22 11:34:38.290: E/AndroidRuntime(336): ... 11 more

编辑:此处提供代码: http://pastebin.com/VSvWvgGa

EDIT2:此处提供XML: http://pastebin.com/uGLpyUcW

EDIT3:在进行Druv建议的初始更改后,我遇到了新的logcat错误,并且用这些错误更新了我的帖子

EDIT4:R.layout.main.xml: http://pastebin.com/Qe8Bx47m

最佳答案

    AndroidManifest.xml 
<application android:name="ComplimentGenerator" android:icon="@drawable/icon">

Just Rename Your
android:name="ComplimentGenerator" to android:label="ComplimentGenerator"

关于android - Android应用程式在开启时当机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9398439/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com