简体   繁体   English

Eclipse在尝试启动Android应用时遇到困难

[英]Eclipse gets stuck when trying to launch Android app

I'm trying to run helloandroid application on a Motorola Milestone A853. 我正在尝试在摩托罗拉Milestone A853上运行helloandroid应用程序。 I typed "adb devices" and the mobile is properly recognized. 我输入“adb devices”并正确识别移动设备。 However, when I try to run the application Eclipse always stuck at 27% "Launching delegate". 但是,当我尝试运行应用程序时,Eclipse总是停留在27%“启动委托”。

Which could be the reason? 这可能是什么原因?

Had the same 27% problem with an emulator. 模拟器有27%的问题。 It only got fixed after I deleted the AVD and recreated it, so this is very likely device/emulator related (and furthermore restarting the ADB did not fix the problem). 它只有在我删除AVD并重新创建它后才得到修复,因此这很可能与设备/仿真器相关(并且进一步重新启动ADB并没有解决问题)。

EDIT: 编辑:

Found this over at project pages as Issue #21073, answered by benpar: 在问题#21073的项目页面上找到了这个,benpar回答说:

Update: This scenario can also be avoided if the AVD emulator is launched from the AVD Manager within Eclipse. 更新:如果从Eclipse中的AVD Manager启动AVD仿真器,也可以避免这种情况。 The issue happens when launching the first emulator from the Run button in Eclipse. 从Eclipse中的“运行”按钮启动第一个仿真器时会出现此问题。

To avoid: 避免:

  1. Start Eclipse 启动Eclipse
  2. Window -> AVD Manager 窗口 - > AVD Manager
  3. Start an emulator 启动模拟器
  4. Run the project 运行该项目

I also had this problem when running an application in the emulator. 在模拟器中运行应用程序时,我也遇到了这个问题。 Make sure the emulator is running BEFORE launching the app and you wont have this issue. 在启动应用程序之前确保模拟器正在运行,您不会遇到此问题。

I've found that the quickest way is to check with the Android Debug Bridge on the command line. 我发现最快的方法是在命令行上检查Android Debug Bridge。 Sometimes all it takes is stopping and starting the adb server. 有时只需停止并启动adb服务器即可。 That is: 那是:

adb kill-server

Will stop the server. 将停止服务器。 Then: 然后:

adb start-server

That should do it. 应该这样做。 Check the attached devices ( but it's not necessary ) 检查连接的设备(但没有必要)

adb devices

and it lists the devices attached. 它列出了附加的设备。
Then go back to eclipse and start debugging again. 然后回到eclipse并再次开始调试。

This can also be done in the Devices view through Eclipse. 这也可以在Eclipse的Devices视图中完成。

To get further information, try installing and launching the application from the command line outside of Eclipse. 要获取更多信息,请尝试从Eclipse外部的命令行安装和启动应用程序。 You'll find your .apk in the /bin folder of your project, then use: 您将在项目的/ bin文件夹中找到.apk,然后使用:

adb install -r <projectname>.apk

It may work and if not, you may get better information about the cause of the error. 它可能有效,如果没有,您可能会获得有关错误原因的更好信息。 My experience with Eclipse has shown that it can be finicky at times and this should help you isolate the issue. 我对Eclipse的经验表明,它有时很挑剔,这可以帮助你找出问题所在。

I had the same stuck at 27% problem. 我遇到了同样困在27%的问题。 Unplugging the device and plugging it back in fixed it. 拔下设备并将其插回固定设备。

I got the solution of this problem bit silly one. 我得到了这个问题的解决方案有点傻了。 What i did was started emulator from one instance of eclipse.. Closed eclipse. 我做的是从一个eclipse实例开始模拟器。封闭的日食。 Closing eclipse wont stop the emulator. 关闭日食不会停止模拟器。 Now re-launch eclipse. 现在重新启动eclipse。 Now run your application in the emulator already running. 现在在已经运行的模拟器中运行您的应用程序。

Very annoying problem. 非常讨厌的问题。 I was having to close down eclipse and the emulator and then start up again which became time consuming. 我不得不关闭eclipse和模拟器,然后重新启动,这变得非常耗时。 Came here and read what Anna Lear and Vinay posted. 来到这里阅读Anna Lear和Vinay发布的内容。 Worked! 成功了! I think in my case this problem happened because I exited eclipse while the emulator was still running. 我认为在我的情况下发生这个问题是因为我在模拟器仍在运行时退出了eclipse。 To correct, as Anna and Vinay posted, do this... 为了纠正,正如安娜和维奈发布的那样,这样做......

Make sure eclipse and emulator are shut down, then... 确保关闭eclipse和模拟器,然后......

  1. start elipse 开始elipse
  2. start emulator 启动模拟器
  3. quit eclipse (do not quit the emulator) 退出eclipse(不要退出模拟器)
  4. start eclipse 开始日食
  5. now run your program (should load 100% and not get stuck) 现在运行你的程序(应该加载100%并且不会卡住)

For me it was the ADB which had hung. 对我来说,亚行已经挂了。 No amount of quitting either eclipse or the emulator had any effect. 无论是日食还是模拟器都没有任何效果。

  1. Terminate the emulator 终止模拟器
  2. Terminate the ADB, (I simply killed its process using task manager. 终止ADB,(我简单地使用任务管理器终止了它的进程。
  3. Start the emulator again, (also causes the ADB to restart) 再次启动模拟器,(也会导致ADB重新启动)
  4. Run your program 运行你的程序

It should no longer get stuck. 它应该不再卡住。

I was using Samsung Galaxy to run the app. 我正在使用三星Galaxy来运行该应用程序。 I wasted a lot of time in running app but it was not launching and i had to restart eclipse every time. 我浪费了很多时间来运行应用程序,但它没有启动,我不得不每次重启eclipse。 For me, i just follow these steps and there was no problem any more 对我来说,我只是遵循这些步骤,不再有任何问题

  • removed my device from my PC 从我的电脑上删除了我的设备
  • Run the app 运行应用程序
  • When it asks for attach your device or create AVD. 当它要求连接您的设备或创建AVD时。
  • I reconnect my device and select for output. 我重新连接我的设备并选择输出。
  • Finally i resolved the issue 最后我解决了这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM