0

我正在尝试在我的智能手机(运行 Android 2.3)上运行一个示例蓝牙聊天应用程序。Eclipse 中的目标构建项目使用 Android API 级别 10

the same project includes this in the manifest:

<uses-sdk minSdkVersion="6" android:targetSdkVersion="10"  />

我该如何解决这个问题?任何的想法

这些是我的控制台错误

  2012-05-09 12:30:09 - BluetoothChat] Android Launch!
  [2012-05-09 12:30:09 - BluetoothChat] adb is running normally.
  [2012-05-09 12:30:09 - BluetoothChat] Performing     com.example.android.BluetoothChat.BluetoothChat activity launch
 [2012-05-09 12:30:09 - BluetoothChat] Automatic Target Mode: Several compatible targets.   Please select a target device.
[2012-05-09 12:30:13 - BluetoothChat] WARNING: Application does not specify an API level requirement!
[2012-05-09 12:30:13 - BluetoothChat] Device API version is 10 (Android 2.3.3)
[2012-05-09 12:30:13 - BluetoothChat] Uploading BluetoothChat.apk onto device 'emulator-5556'
[2012-05-09 12:30:14 - BluetoothChat] Installing BluetoothChat.apk...
[2012-05-09 12:30:21 - BluetoothChat] Success!
[2012-05-09 12:30:21 - BluetoothChat] Starting activity com.example.android.BluetoothChat.BluetoothChat on device emulator-5556
[2012-05-09 12:30:23 - BluetoothChat] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.android.BluetoothChat/.BluetoothChat }

和 logcat 显示这些错误

  05-09 06:53:04.284: W/dalvikvm(435): threadid=1: thread exiting with uncaught exception (group=0x40015560)
05-09 06:53:04.524: E/AndroidRuntime(435): FATAL EXCEPTION: main
05-09 06:53:04.524: E/AndroidRuntime(435): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.BluetoothChat/com.example.android.BluetoothChat.BluetoothChat}: java.lang.ClassNotFoundException: com.example.android.BluetoothChat.BluetoothChat in loader dalvik.system.PathClassLoader[/data/app/com.example.android.BluetoothChat-2.apk]
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.os.Looper.loop(Looper.java:123)
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.app.ActivityThread.main(ActivityThread.java:3683)
05-09 06:53:04.524: E/AndroidRuntime(435):  at java.lang.reflect.Method.invokeNative(Native Method)
05-09 06:53:04.524: E/AndroidRuntime(435):  at java.lang.reflect.Method.invoke(Method.java:507)
05-09 06:53:04.524: E/AndroidRuntime(435):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-09 06:53:04.524: E/AndroidRuntime(435):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-09 06:53:04.524: E/AndroidRuntime(435):  at dalvik.system.NativeStart.main(Native Method)
05-09 06:53:04.524: E/AndroidRuntime(435): Caused by: java.lang.ClassNotFoundException: com.example.android.BluetoothChat.BluetoothChat in loader dalvik.system.PathClassLoader[/data/app/com.example.android.BluetoothChat-2.apk]
05-09 06:53:04.524: E/AndroidRuntime(435):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-09 06:53:04.524: E/AndroidRuntime(435):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-09 06:53:04.524: E/AndroidRuntime(435):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-09 06:53:04.524: E/AndroidRuntime(435):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
05-09 06:53:04.524: E/AndroidRuntime(435):  ... 11 more
05-09 06:57:27.854: I/Process(435): Sending signal. PID: 435 SIG: 9
4

1 回答 1

2

检查 Eclipse 项目的类路径project.properties文件,我认为它没有正确设置。尝试这种方式,使用您之前创建的普通项目中的这些文件的信息。也许它会有所帮助。

于 2012-05-09T07:26:37.813 回答