eclipse 无法读取... AndroidManifest.xml - 尝试 Android 记事本教程时 - 练习 1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5025152/
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
Can't read ... AndroidManifest.xml - while attempting Android Notepad Tutorial - Exercise 1
提问by Joe Cullity
I'm working "Exercise 1" of the Notepad Tutorial
我正在做“练习 1” Notepad Tutorial
and have done step #1, and am just beginning on step #2
1 Start a new Android Project by clicking File > New > Android Project
.
2 In the New Android Project dialog
, select Create project from existing source.
并且已经完成了第 1 步,我刚刚开始第 2 步
1 通过单击启动一个新的 Android 项目File > New > Android Project
。
2 在 中New Android Project dialog
,选择Create project from existing source.
So, the tutorial says to click [File], [New], [Android Project] -BUT- what I seem to have to do is click on [File], [New], [Project], [Android Project] Maybe this is a typeo in the tutorial, or am I missing something?
所以,教程说点击 [File], [New], [Android Project] -BUT- 我似乎要做的是点击 [File], [New], [Project], [Android Project] 也许这个是教程中的类型,还是我遗漏了什么?
Anyway things seem to be OK until I follow the instructions to click on
[x] Create project from existing source
And then I instantly get 2 entries into the error log that both read
Unable to read C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-
无论如何,事情似乎没问题,直到我按照说明单击
[x] 从现有源创建项目
然后我立即在错误日志中获得了 2 个条目,它们都读取了 Unable to read C:\Andriod\Andriod-SDK-Windows\ AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-
Since I have never tried to create a project from existing code before, maybe something went wrong with the original install, and I'm just stumbling across the problem now?
由于我以前从未尝试过从现有代码创建项目,因此原始安装可能出现问题,而我现在只是偶然发现了这个问题?
If anyone really wants to read it, Full error log output follows
Thanks Joe
如果有人真的想阅读它,完整的错误日志输出如下
谢谢乔
=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Error Log Follows -=-=-=-=-=-=-=-=-=-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 错误日志如下 -=-=-=-=-=-=-=-=-= -=
~ !SESSION 2011-02-16 23:08:27.651 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_23
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
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product
!ENTRY com.android.ide.eclipse.adt 4 0 2011-02-16 23:09:28.468
!MESSAGE Unable to read C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)
!STACK 0
com.android.sdklib.io.StreamException: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)
at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:92)
at com.android.sdklib.xml.AndroidManifestParser.parse(AndroidManifestParser.java:608)
at com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parse(Unknown Source)
at com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parseForData(Unknown Source)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.extractNamesFromAndroidManifest(Unknown Source)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.access(Unknown Source)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.widgetSelected(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:90)
... 42 more
!ENTRY com.android.ide.eclipse.adt 4 0 2011-02-16 23:09:28.597
!MESSAGE Unable to read C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)
!STACK 0
com.android.sdklib.io.StreamException: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)
at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:92)
at com.android.sdklib.xml.AndroidManifestParser.parse(AndroidManifestParser.java:608)
at com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parse(Unknown Source)
at com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parseForData(Unknown Source)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.extractNamesFromAndroidManifest(Unknown Source)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.access(Unknown Source)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.widgetSelected(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:90)
... 42 more ~$~
采纳答案by shaggy
Go to Eclipse --> Window --> Preferencesand set your working location for Android SDK properly.
转到Eclipse --> 窗口 --> 首选项并正确设置 Android SDK 的工作位置。
回答by w.donahue
It does that every time for me as well but it works just fine. Just ignore those errors.
它每次对我来说也是如此,但效果很好。只需忽略这些错误。