Android-Hello World

发布于 2024-09-25 13:13:11 字数 740 浏览 7 评论 0原文

我目前正在学习如何创建 Android 应用程序,因此我从 Android 开发人员主页上的基本“Hello World”教程开始。代码非常简单,但是当我运行它时(我使用 Eclipse 和 AVD v2.2),它只显示“Android”。它不会进入主屏幕。我更新了所有内容,但仍然遇到同样的问题。是否有我没有做的事情或

新错误:

[2010-09-29 09:35:04 - DeviceMonitor]Sending jdwp tracking request failed!

[2010-09-29 09:41:50 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-09-29 10:16:23 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2010-09-29 10:16:28 - HelloAndroid] Installing HelloAndroid.apk...
[2010-09-29 10:20:27 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
[2010-09-29 10:20:27 - HelloAndroid] (null)
[2010-09-29 10:20:29 - HelloAndroid] Launch canceled!

I'm currently learning how to create android applications so I started with the basic "Hello World" tutorial over at the Android Developers home page. The code is quite simple but when I run it(I'm using Eclipse and a AVD v2.2), it only shows "Android." It does not go to the Home Screen. I updated everything and I still get the same problem. Is there something I did not or

New errors:

[2010-09-29 09:35:04 - DeviceMonitor]Sending jdwp tracking request failed!

[2010-09-29 09:41:50 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-09-29 10:16:23 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2010-09-29 10:16:28 - HelloAndroid] Installing HelloAndroid.apk...
[2010-09-29 10:20:27 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
[2010-09-29 10:20:27 - HelloAndroid] (null)
[2010-09-29 10:20:29 - HelloAndroid] Launch canceled!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

听,心雨的声音 2024-10-02 13:13:11

我假设你正在使用模拟器。你必须要有耐心;启动需要很长时间(几分钟)。您可以手动启动模拟器,方法是转到 Eclipse 中的“窗口”菜单,选择“Android SDK 和 ADB 管理器”,单击您创建的模拟器,然后单击开始按钮。等到您看到主屏幕。如有必要,请通过在屏幕上单击并向下拖动鼠标直至解锁来解锁。

如果您可以使用实体手机和 USB 数据线,则总体上您将获得更好(更快)的体验。

祝你好运!

I assume you are using the emulator. You have to be patient; it takes a very long time to start up (several minutes.) You can start the emulator manually by going to the Window menu in Eclipse, selecting "the Android SDK and ADB manager," clicking on the emulator you created and then clicking on the Start button. Wait until you see the home screen. If necessary, unlock it by clicking and dragging the mouse down over the screen until it's unlocked.

If you have access to a physical phone and USB cable, you will have a much better (faster) experience overall.

Good luck!

苏大泽ㄣ 2024-10-02 13:13:11

我也遇到了同样的问题,困扰了两天。但这对我有用。一个你收到这个错误。再次尝试运行您的项目(APP)。它对我有用。

我已经做了一切。挖掘了网络,安装并重新安装了所有东西 4-5 次,包括 JDK。我不确定从长远来看这是否有帮助,但它似乎对我有用。

I had the same problem and was bugged by it for two days. but this is what worked for me. one you get this error. try running your project (APP) again. it did the trick for me.

I had done everything. digged the web, installed and re-installed everything 4-5 times including the JDK as well. m not sure if it will help in the long run, but it seems to have worked for me.

缪败 2024-10-02 13:13:11

对于我来说,我遇到了同样的问题,它有助于增加 SD 卷和最大 VM 应用程序堆大小。 (Android SDK 和 AVD 管理器 - 虚拟设备 - 编辑)有趣的是,SD 和堆恢复到以前的值也可以。这意味着,模拟器参数的任何更改及其重建就足够了。 (简单的重新启动没有帮助)

当然,它比完全重新安装便宜。 :-)

As for me, I had the same problem and it helped to increase SD volume and max VM app heap size. (Android SDK and AVD manager - Virtual device - Edit) What is interesting, the back change of SD and heap to the previous values is OK, too. That means, that any change of emulator parameters and its rebuilding is enough. (Simple restart won't help)

Definitely, it is cheaper, than total reinstalling. :-)

甜`诱少女 2024-10-02 13:13:11

从模拟器解锁屏幕。这对我来说很有效。

unlock the screen from the emulator. That did the trick for me.

儭儭莪哋寶赑 2024-10-02 13:13:11

转到运行配置并选择目标选项卡。在此选项卡下,您可以看到您的目标。然后选择自动单选按钮并选中 AVD 复选框。然后尝试运行,很可能你的问题就会得到解决。

go to the run configurations and select target tab. under this tab you can see your targets. then select automatically radio button and select a check box of AVD. then try to run, most probably your issue will be solved.

空气里的味道 2024-10-02 13:13:11

我有同样的问题,这就是我解决的方法。

如果你跑

adb 设备

我什么都没有就行了。也是如此。

adb 终止服务器

adb 启动服务器

现在,如果您再次运行模拟器,Activity oncreate 事件将正确挂接。
不确定这是否是有意的,但在模拟器上第一次运行时不起作用。
有人证实这一点吗?
谢谢。

I had the same problem and this is how I resolved.

if you run

adb devices

I had nothing on the list. So did.

adb kill-server

and

adb start-server

Now if you run the emulator again, the Activity oncreate event will hook properly.
Not sure if this is intended but on the first run on the emulator does not work.
And someone confirm on this?
Thanks.

别理我 2024-10-02 13:13:11

我在 Eclipse 上运行 Android 3.1 Java 1.6 时遇到了同样的问题。只需重新运行构建过程,它就会第二次启动。

I had the same problem I was running Android 3.1 Java 1.6 on Eclipse. Just rerun the build process and it kicks in the second time.

司马昭之心 2024-10-02 13:13:11

我在按照说明操作时也遇到了错误,所以我运行了“adb logcat”,这表明它无法找到该类。

在说明(教程)中 - :据说(在创建新项目或类期间)应用程序名称设置为 Hello World,活动名称变为 HelloWorldActivity。

因此,如果您保持 CreateActivity 名称和应用程序名称相同,那么它可能会起作用。

我已将 AVD RAM 大小增加到 1024,并将 VM 应用程序增加到 36 0r 48 或 24。

I also encountered error when followed instructions, so i ran "adb logcat" which showed that it is not able to find the class.

In the instructions(tutorial) - : It has been said that (during create new project or class)application name set to Hello World and activity name became HelloWorldActivity.

So if you maintain both CreateActivity name and application name both same, then it might work.

I have increased the AVD RAM size to 1024 and VM application to 36 0r 48 or 24.

找回味觉 2024-10-02 13:13:11

如果有人遇到以下错误,

[2010-09-29 09:35:04 - DeviceMonitor]发送jdwp跟踪请求失败!

[2010-09-29 09:41:50 - HelloAndroid] 执行 com.example.helloandroid.HelloAndroid 活动启动
[2010-09-29 10:16:23 - HelloAndroid] 将 HelloAndroid.apk 上传到设备“emulator-5554”上
[2010-09-29 10:16:28 - HelloAndroid] 正在安装HelloAndroid.apk...
[2010-09-29 10:20:27 - HelloAndroid] 无法在设备“emulator-5554”上安装 HelloAndroid.apk!
[2010-09-29 10:20:27 - HelloAndroid](空)
[2010-09-29 10:20:29 - HelloAndroid] 启动取消!

只需重新启动您的应用程序即可。
等待一段时间。因为这需要一些时间。
当您看到带有“数据-时间-充电-锁定”的屏幕时,
点击锁。会有一些动画。再次点击同一个锁。
并且你已经完成了。你将得到输出............

If anyone getting following error,

[2010-09-29 09:35:04 - DeviceMonitor]Sending jdwp tracking request failed!

[2010-09-29 09:41:50 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-09-29 10:16:23 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2010-09-29 10:16:28 - HelloAndroid] Installing HelloAndroid.apk...
[2010-09-29 10:20:27 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
[2010-09-29 10:20:27 - HelloAndroid] (null)
[2010-09-29 10:20:29 - HelloAndroid] Launch canceled!

Simply restart your application.
Wait for some time.Bcaz it take some time.
when you will get screen with "Data-time-charging-lock",
click on lock .There will be some animation.Again click on same lock.
AND Your Are DONE.You will get output..........

原谅过去的我 2024-10-02 13:13:11

这种情况一直发生在我身上...我解决的方法是在命令提示符中使用“ adb install ”...如果 adb.exe 不在您的路径中,则搜索它。通过运行配置并点击运行来确保模拟器正在运行。这将启动模拟器而不安装您的 apk 文件。模拟器启动后,运行上面列出的命令提示符。

this kept happening to me ... how i solved it was to use " adb install " in a command prompt ...search for adb.exe if its not in your path. Make sure the emulator is running by going to run configuration and hitting run. This starts the emulator without installing your apk file. After the emulator starts up run the command prompt stuff listed above.

静若繁花 2024-10-02 13:13:11

我重新启动了虚拟设备,并选中了擦除用户数据选项,然后重新运行了我的应用程序。这终于对我有用了。

请注意,为了回应其他评论,我还尝试了以下操作:

  • 简单地重新启动设备
  • 更改 VM 堆大小后重新启动设备
  • 重新启动我的计算机

I restarted my virtual device with the option Wipe User Data checked and then reran my app. That finally worked for me.

Note that in response to the other comments, I also tried the following:

  • Simply restarting the device
  • Restarting the device after changing the VM heap size
  • Restarting my computer
满天都是小星星 2024-10-02 13:13:11

您可能想尝试使用 Android Studio 的 AVD。 AVD 似乎更适合我。

You might want to try out using Android Studio's AVD. That AVD seems to work better for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文