我正在用android开发我的项目。它的位置服务。在这里,我尝试在单个项目下组合三个活动。所以我在布局中创建了三个xml文件。并且还包括Manifest中的三个活动。但是,当我尝试执行我的项目时,它显示应用程序已意外停止。请再试一次。我认为这个错误发生在R.java中。但我不知道确切的错误。请帮助我。
我的logcat显示如
05-14 00:00:34.096: W/dalvikvm(356): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
05-14 00:00:34.118: E/AndroidRuntime(356): Uncaught handler: thread main exiting due to uncaught exception
05-14 00:00:34.206: E/AndroidRuntime(356): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.google.apis/com.androd.speech.TtsActivity}: java.lang.ClassNotFoundException: com.androd.speech.TtsActivity in loader dalvik.system.PathClassLoader@44e84190
05-14 00:00:34.206: E/AndroidRuntime(356): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
05-14 00:00:34.206: E/AndroidRuntime(356): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
05-14 00:00:34.206: E/AndroidRuntime(356): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
05-14 00:00:34.206: E/AndroidRuntime(356): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
05-14 00:00:34.206: E/AndroidRuntime(356): at android.os.Handler.dispatchMessage(Handler.java:99)
05-14 00:00:34.206: E/AndroidRuntime(356): at android.os.Looper.loop(Looper.java:123)
05-14 00:00:34.206: E/AndroidRuntime(356): at android.app.ActivityThread.main(ActivityThread.java:4363)
05-14 00:00:34.206: E/AndroidRuntime(356): at java.lang.reflect.Method.invokeNative(Native Method)
05-14 00:00:34.206: E/AndroidRuntime(356): at java.lang.reflect.Method.invoke(Method.java:521)
05-14 00:00:34.206: E/AndroidRuntime(356): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-14 00:00:34.206: E/AndroidRuntime(356): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-14 00:00:34.206: E/AndroidRuntime(356): at dalvik.system.NativeStart.main(Native Method)
05-14 00:00:34.206: E/AndroidRuntime(356): Caused by: java.lang.ClassNotFoundException: com.androd.speech.TtsActivity in loader dalvik.system.PathClassLoader@44e84190
05-14 00:00:34.206: E/AndroidRuntime(356): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
05-14 00:00:34.206: E/AndroidRuntime(356): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
05-14 00:00:34.206: E/AndroidRuntime(356): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
05-14 00:00:34.206: E/AndroidRuntime(356): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-14 00:00:34.206: E/AndroidRuntime(356): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
05-14 00:00:34.206: E/AndroidRuntime(356): ... 11 more
05-14 00:00:34.266: I/dalvikvm(356): threadid=7: reacting to signal 3
05-14 00:00:34.368: I/dalvikvm(356): Wrote stack trace to '/data/anr/traces.txt'
05-14 00:05:20.357: I/Process(356): Sending signal. PID: 356 SIG: 9
答案 0 :(得分:0)
您使用文字转语音吗?从logcat看起来就像你一样。 要使用TTS,您必须先检查设备上是否安装了TTS。
此答案显示了如何检查它是否已安装:
答案 1 :(得分:0)
这可能与此处的问题相同
Unable to Instantiate Service: ClassNotFoundException
由于最近的ADT更新,只需要将“lib”文件夹更改为“libs”...