无法在AVD上获得世界加载的问候

时间:2010-09-20 18:24:50

标签: android

我的Helloworld教程示例构建并运行得很好,除了它没有显示文本(即加载应用程序)。我唯一看到的是模拟器(目标2.2 API级别8)中只出现了“Android”。然后模拟器会在一段时间内显示一个锁定的屏幕。这是控制台的输出

[2010-09-20 10:36:55 - HelloAndroid] Android Launch!
[2010-09-20 10:36:55 - HelloAndroid] adb is running normally.
[2010-09-20 10:36:55 - HelloAndroid] Performing com.example.HelloAndroid.HelloAndroid activity launch
[2010-09-20 10:36:55 - HelloAndroid] Automatic Target Mode: Preferred AVD 'my_avd' is not available. Launching new emulator.
[2010-09-20 10:37:56 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2010-09-20 10:37:56 - HelloAndroid] Device API version is 8 (Android 2.2)
[2010-09-20 10:37:56 - HelloAndroid] HOME is up on device 'emulator-5554'
[2010-09-20 10:38:23 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2010-09-20 10:38:27 - HelloAndroid] Installing HelloAndroid.apk...

退出模拟器后,出现以下错误。

[2010-09-20 09:02:24 - DeviceMonitor]Sending jdwp tracking request failed!
[2010-09-20 09:38:46 - ddms]null
java.lang.NullPointerException
at com.android.ddmlib.JdwpPacket.writeAndConsume(Jdwp Packet.java:213)
at com.android.ddmlib.Client.sendAndConsume(Client.ja va:573)
at com.android.ddmlib.HandleHello.sendHELO(HandleHell o.java:142)
at com.android.ddmlib.HandleHello.sendHelloCommands(H andleHello.java:65)
at com.android.ddmlib.Client.getJdwpPacket(Client.jav a:670)
at com.android.ddmlib.MonitorThread.processClientActi vity(MonitorThread.java:317)
at com.android.ddmlib.MonitorThread.run(MonitorThread .java:263)

[2010-09-20 09:38:47 - ddms]null
java.lang.NullPointerException
at com.android.ddmlib.JdwpPacket.writeAndConsume(Jdwp Packet.java:213)
at com.android.ddmlib.Client.sendAndConsume(Client.ja va:573)
at com.android.ddmlib.HandleHello.sendHELO(HandleHell o.java:142)
at com.android.ddmlib.HandleHello.sendHelloCommands(H andleHello.java:65)
at com.android.ddmlib.Client.getJdwpPacket(Client.jav a:670)
at com.android.ddmlib.MonitorThread.processClientActi vity(MonitorThread.java:317)
at com.android.ddmlib.MonitorThread.run(MonitorThread .java:263)

[2010-09-20 09:50:11 - DeviceMonitor]Sending jdwp tracking request failed!
[2010-09-20 09:59:29 - DeviceMonitor]Sending jdwp tracking request failed!
[2010-09-20 09:59:31 - Logcat]device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.j ava:736)
at com.android.ddmlib.AdbHelper.executeRemoteCommand( AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Devi ce.java:285)
at com.android.ddmuilib.logcat.LogPanel$3.run(LogPane l.java:516)

[2010-09-20 10:40:46 - DeviceMonitor]Sending jdwp tracking request failed!

另外,有没有办法从模拟器出现时运行的CMD窗口捕获TEXT?

2 个答案:

答案 0 :(得分:0)

只需按下模拟器中的“菜单”按钮即​​可。

答案 1 :(得分:0)

这是你的控制台所说的,无论如何你的eclipse无法将最小的sdkversion添加到你的清单

WARNING: Application does not specify an API level requirement!

只需将以下代码添加到清单文件中并检查它是否有效,也可以在运行应用程序之前关闭所有打开的xml文件

<uses-sdk android:minSdkVersion="8" />

尝试一下,说出会发生什么