1

我对 android 应用程序开发和 Eclipse 环境非常陌生。我按照以下步骤在我的工作空间上运行我的第一个 Android 应用程序。

  1. 安装了 Eclipse 4.2(Juno) 版本。
  2. 安装JDK 7U7 64位版本。
  3. 为 Eclipse 安装了 ADT 插件。
  4. Eclipse-> 新建 Android 项目。
  5. 无需对代码进行任何更改,只需运行项目即可。

以下是控制台消息,我得到:

12:03:49,155 INFO  [main] Main  - javax.xml.transform.TransformerFactory=null
12:03:49,157 INFO  [main] Main  - java.endorsed.dirs=C:\Program Files\Java\jre7\lib\endorsed
12:03:49,162 INFO  [main] Main  - launchFile: C:\Users\chandu\workspace\.metadata\.plugins\org.eclipse.wst.xsl.jaxp.launching\launch\launch.xml
12:03:49,219 FATAL [main] Main  - No embedded stylesheet instruction for file: file:/C:/Users/chandu/workspace/My%20First%20App/res/layout/activity_main.xml
org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: file:/C:/Users/chandu/workspace/My%20First%20App/res/layout/activity_main.xml
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:225)
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:186)
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main.main(Main.java:73)
Caused by: org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: file:/C:/Users/chandu/workspace/My%20First%20App/res/layout/activity_main.xml
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:214)
    ... 2 more

在此先感谢您提供有关此问题的任何帮助。

4

2 回答 2

1

您似乎正在尝试运行 activity_main.xml 文件。如果您在 Project Explorer 视图中的当前选择位于文件 activity_main.xml 上,则可能会发生这种情况。关闭文件的编辑器并将当前选择设置为 Project Explorer 中的项目根节点,然后尝试运行应用程序。

于 2012-10-11T08:07:45.550 回答
0

是的。它也从未对我有用。我使用带有插件的 NetBeans 7 IDE。

说明在这里: http: //kenai.com/projects/nbandroid/pages/Install 主页在这里:http: //kenai.com/projects/nbandroid

祝你好运

于 2012-09-22T06:57:18.007 回答