gpt4 book ai didi

android - 应用程序意外停止

转载 作者:行者123 更新时间:2023-11-29 18:09:41 25 4
gpt4 key购买 nike

我是 android 的新手,正在开发一个使用 google maps API 的应用程序。

在运行应用程序时出现错误:

the application has stopped unexpectedly

这是我在 logcat 文件中的内容:

07-11 01:38:25.751: E/AndroidRuntime(401): FATAL EXCEPTION: main
07-11 01:38:25.751: E/AndroidRuntime(401): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.training.surveyproject/com.training.surveyproject.SurveyActivity}: java.lang.ClassNotFoundException: com.training.surveyproject.SurveyActivity in loader dalvik.system.PathClassLoader[/data/app/com.training.surveyproject-2.apk]
07-11 01:38:25.751: E/AndroidRuntime(401): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
07-11 01:38:25.751: E/AndroidRuntime(401): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-11 01:38:25.751: E/AndroidRuntime(401): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-11 01:38:25.751: E/AndroidRuntime(401): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-11 01:38:25.751: E/AndroidRuntime(401): at android.os.Handler.dispatchMessage(Handler.java:99)
07-11 01:38:25.751: E/AndroidRuntime(401): at android.os.Looper.loop(Looper.java:123)
07-11 01:38:25.751: E/AndroidRuntime(401): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-11 01:38:25.751: E/AndroidRuntime(401): at java.lang.reflect.Method.invokeNative(Native Method)
07-11 01:38:25.751: E/AndroidRuntime(401): at java.lang.reflect.Method.invoke(Method.java:521)
07-11 01:38:25.751: E/AndroidRuntime(401): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-11 01:38:25.751: E/AndroidRuntime(401): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-11 01:38:25.751: E/AndroidRuntime(401): at dalvik.system.NativeStart.main(Native Method)
07-11 01:38:25.751: E/AndroidRuntime(401): Caused by: java.lang.ClassNotFoundException: com.training.surveyproject.SurveyActivity in loader dalvik.system.PathClassLoader[/data/app/com.training.surveyproject-2.apk]
07-11 01:38:25.751: E/AndroidRuntime(401): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
07-11 01:38:25.751: E/AndroidRuntime(401): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
07-11 01:38:25.751: E/AndroidRuntime(401): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
07-11 01:38:25.751: E/AndroidRuntime(401): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-11 01:38:25.751: E/AndroidRuntime(401): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
07-11 01:38:25.751: E/AndroidRuntime(401): ... 11 more

谢谢

最佳答案

您必须将 Activity SurveyActivity 添加到您的 AndroidManifest.xml 文件中。

您可能还忘记了将 Google map 库添加到 list 中:

<application>
<uses-library android:name="com.google.android.maps" />
</application>

关于android - 应用程序意外停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11424436/

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