尝试运行 Android 应用程序时出现 Eclipse 启动错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2143392/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse launch error when trying to run an Android app
提问by user259642
I'm trying to set up my workstation for Android development with Eclipse Galileo. I installed the latest ADT plugin and the Android SDK, but I get this error when I try to run any basic Android project I create.
我正在尝试使用 Eclipse Galileo 为 Android 开发设置我的工作站。我安装了最新的 ADT 插件和 Android SDK,但是当我尝试运行我创建的任何基本 Android 项目时出现此错误。
eclipse.buildId=M20090917-0800
java.version=1.6.0_17
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product -data C:\Documents and Settings\dmcnamar\workspace -product org.eclipse.epp.package.java.product
Error
Tue Jan 26 18:00:41 EST 2010
An internal error occurred during: "Launching HelloWorld".
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(Unknown Source)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(Unknown Source)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(Unknown Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
at org.eclipse.debug.internal.ui.DebugUIPlugin.run(DebugUIPlugin.java:1069)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
回答by Kamesh Kompella
In my case, the problem went away when I chose an AVD. I was using an eclipse project and the run configuration had a valid AVD but it was not checked. Once I checked the checkbox, the problem went away.
就我而言,当我选择 AVD 时,问题就消失了。我正在使用一个 eclipse 项目并且运行配置有一个有效的 AVD,但它没有被检查。一旦我选中了复选框,问题就消失了。
Regards Kamesh
问候卡梅什
回答by william
I right-clicked above the manifest.xml file, selected option Run As -> Run Configurations -> on a tab Target, and selected AVD created. I'm using Eclipse Helios for Linux 32b,
我在 manifest.xml 文件上方右键单击,选择选项 Run As -> Run Configurations -> 在选项卡 Target 上,然后选择创建的 AVD。我在 Linux 32b 上使用 Eclipse Helios,
回答by Rauf Shaikh
I right-clicked above the manifest.xml file, selected option Run As -> Run Configurations -> on a tab Target, and selected AVD created
我在 manifest.xml 文件上方右键单击,选择选项 Run As -> Run Configurations -> on a tab Target,然后选择 AVD created
回答by kenju254
I had this problem myself, confirm that you have a Virtual Device on your AVD. My Error occurred simply because I did not have any Virtual Device.
我自己也遇到过这个问题,请确认您的 AVD 上有虚拟设备。我的错误发生只是因为我没有任何虚拟设备。
Another thing to consider is that, If you have your Virtual device, remember to always install the SDK before you start your AVD. I had overlooked this and wasted a lot of time wondering why my AVD is not working. how do you expect your virtual device to work with no OS..
要考虑的另一件事是,如果您有虚拟设备,请记住在启动 AVD 之前始终安装 SDK。我忽略了这一点,浪费了很多时间想知道为什么我的 AVD 不工作。您如何期望您的虚拟设备在没有操作系统的情况下工作..
This are just a few problems that beginners will always encounter when starting out...
这只是初学者在开始时总会遇到的一些问题......
My advice be keen to detail don't rush into running your Hello World application
我的建议是详细说明不要急于运行您的 Hello World 应用程序
回答by user259642
The app worked fine when I pushed it to a physical device, so I figured I'd check the virtual devices some more. From running "adb.exe devices" I see a virtual device in there called ""emulator-5554". When I select this one to run I get the error still, but when I choose "Launch New Virtual Device" I get it to work. When I run "android list avds" it doesn't display the first device, so it looks like a bad device got created somehow causing the error. Thanks for the help!
当我将它推送到物理设备时,该应用程序运行良好,所以我想我会再检查一下虚拟设备。从运行“adb.exe devices”我看到一个名为“emulator-5554”的虚拟设备。当我选择这个运行时,我仍然得到错误,但是当我选择“Launch New Virtual Device”时,我得到它工作。当我运行“android list avds”时,它不显示第一个设备,所以看起来像是以某种方式创建了一个坏设备,导致了错误。感谢您的帮助!
回答by Mikael Setterberg
This might already be solved, but in case someone else stumbles on the same issue. I solved it by making a copy of the project, delete it from the workspace and import it back again. Now it all works like a charm. I believe this started after I removed a virtual device from AVD manager.
这可能已经解决了,但万一其他人偶然发现了同样的问题。我通过制作项目的副本,将其从工作区中删除并再次导入来解决了该问题。现在这一切都像一个魅力。我相信这是在我从 AVD 管理器中删除虚拟设备后开始的。