[英]Running an Android App in Eclipse Causes NullPointerException
I have been following the Android getting started docs and when I try to run the project I get: 我一直在关注Android 入门文档 ,当我尝试运行该项目时,我得到了:
!MESSAGE An internal error occurred during: "Launching HelloAndroid".
!STACK 0
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(Unknown Source)
The application doesn't launch. 该应用程序无法启动。
On Top Menu go to "Run" then "Run Configurations" and select your target virtual device. 在顶部菜单上,依次单击“运行”和“运行配置”,然后选择目标虚拟设备。 Click apply, and then run the project.
单击“应用”,然后运行项目。
Unplugging my Nexus One and restarting Eclipse fixed the problem. 拔下Nexus One并重新启动Eclipse即可解决此问题。 Not sure why.
不知道为什么。
Now you can run or debug your Android Project. 现在,您可以运行或调试Android项目。
Most likely you need to delete the existing launcher and recreate it as described in the other answers. 您很有可能需要删除现有的启动器,然后按照其他答案中的说明重新创建它。 You probably did some kind of refactoring or editing of the manifest file and the run configuration for some reason was not automatically updated.
您可能对清单文件进行了某种重构或编辑,由于某种原因,运行配置没有自动更新。 Maybe because your Eclipse plugin or SDK are outdated.
可能是因为您的Eclipse插件或SDK已过时。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.