android eclipse 让我发疯了?
我对 Android 开发特别是 Eclipse 还很陌生。
我正忙于一个名为“HelloEclipse”的项目。我面临着一些重大的改变,其中我必须做出一些非常大的改变。
所以我制作了一个 c:\workspace\HelloEclipse
的 zip 文件,并将其放在保存位置。继续从事我的项目。几个小时后,我想回到保存的情况。关闭 Ecplise,重新启动计算机,因为我想确保没有锁定的文件。删除旧的 c:\workspace\HelloEclipse
文件夹,将 ZIP 文件中的版本放回原处。
这导致工作区状态完全损坏。不能前进,也不能后退。我最终创建了一个新项目,并粘贴了所有内容,花了我几个小时。我认为这是相当愚蠢的 Eclipse 行为。我也尝试过从 Eclipse 中导出/导入存档,但也没有成功。
所以两个问题;
我应该如何保存项目(不安装类似 subversion 的东西)?
为什么保存文件不够,为什么会导致 Eclipse 崩溃?
提前致谢!
丹尼斯
I've quite new to Android development and specially Eclipse.
I'm busy on a project called, say 'HelloEclipse'. I've had some major changes ahead, in which I had to some very big changes.
So I made a zip file of c:\workspace\HelloEclipse
, placed that in a save place. Went on to work on my project. Few hours later, I wanted to go back to the saved situation. Closed Ecplise, rebooted my computer, because I wanted to make sure there were no locked files. Deleted the old c:\workspace\HelloEclipse
folder, place the version out of the ZIP file back.
This resulted in a totally corrupted workspace status. Could not go foward, nor backward. I've ended up, creating a new project, and pasted in everything, took me hours. I think this is quite stupid Eclipse behavior. I've also tried ot, export/import with a archive from out of Eclipse, also not succesfull.
So the two questions;
How am I suppose to save projects (without installing anything like subversion)?
Why is saving the files not enough, and why does that make Eclipse barf?
Thanks in advance!
Dennis
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在 Eclipse 中,如果您想从 ZIP 重新导入旧项目,不要只是将项目文件复制到工作区,而是将文件解压到工作区之外的普通目录。
正常打开 Eclipse 并选择 File>New Project>Android Project,就像创建新的 Android 项目一样,但是在新的 Android 项目窗口中,您有一个单选按钮,可以选择从现有源创建项目,将其指向您提取旧项目的目录,它应该重新导入到工作区中。
或者执行“文件”>“导入”>“将现有项目导入工作区”。
但无论如何,不要手动将文件放入工作区以避免冲突,Eclipse 在导入时会自行复制所需的文件。
In eclipse if you want to reimport an old project from a ZIP, don't just copy the project files to the workspace, instead, extract the files to a normal dir outside the workspace.
Open Eclipse normally and select File>New Project>Android Project, just as you would to to create a new Android project, but then in the new android project window, you have a radio button giving you the choice to Create project from existing source, point it to the directory where you have extracted your old project and it should be re-imported to the WorkSpace alright.
Or do File>Import>Import existing project into workspace.
But in any case, don't put the files in the workspace manually to avoid conflicts, Eclipse will copy the files it needs itself upon importing.
您可能错过了一些隐藏的工作区文件——特别是 .classpath 和 .project。也就是说,制作备份副本(例如,发布版本的备份副本,以便您可以在支持该版本的同时继续开发)要容易得多,只需右键单击 Eclipse 中项目的顶层并选择“复制”,然后右键单击并选择粘贴。在有机会命名该副本后,结果将是该项目的副本。
如果您想压缩项目,可以通过导出它们来实现。如果您想删除现有项目,您应该在 Eclipse 中右键单击来执行此操作。您可以导入之前导出的 zip 文件。
There are hidden workspace files that you may have missed -- specifically, .classpath and .project. That said, it's a lot easier to make a backup copy (for example, of a released version so you can continue developing while supporting the release) by simply right-clicking on the top-level of the project in Eclipse and selecting Copy, then right-clicking and selecting Paste. The result will be a copy of the project after an opportunity to name the copy.
If you want to zip projects, you can do that by exporting them. If you want to delete existing projects, you should do that from inside Eclipse with a right-click. You can import the zip you previously exported.
如果通过保存,您的意思是备份,最好的方法是创建本地存储库。如果我是你,我也会将我的代码备份到在线存储库中;以使其免受硬件崩溃或其他灾难的影响。
在您的问题中,您可以尝试单独删除项目并导入备份副本(从压缩文件中),而不是删除整个工作区。无法查明 Eclipse 崩溃的确切原因,但可能是因为它搞乱了 Eclipse 的工作区设置。在相关说明中,我在网上发现了这个。
Eclipse 有时相当麻烦,但据我所知,它是 Android 最好的 IDE。
If by save, you meant backing up the best something would be to create a local repository. If I were you, I would backup my code in an online repository too; to save it from hardware crashes or other disasters.
In your problem, you could have tried deleting the project alone and import the backup copy(from the zipped file) instead of deleting the entire workspace. Can't pinpoint the exact reason of why eclipse barfed but maybe because it messed up the workspace settings for eclipse. On a related note, I found this on the net.
Eclipse is rather troublesome at times but AFAIK it's the best IDE for android.
首先,经过几个月的 Eclipse 开发,我转向了 IntelliJ(他们有社区版),我发现它好多了。
在intelliJ中,您可以保存本地历史记录,例如,您可以设置一个标签并随时返回该标签,而不会丢失任何内容。
至于eclipse,你可能没有压缩一些隐藏文件什么的。
另外,我记得有一些类似的问题,我必须将文件与项目重新同步,尝试 这个
祝你好运
First of all, after several months of developing with eclipse I moved to IntelliJ (they have a community edition) and I found it much much better.
In intelliJ you can save local history, for example, you can set-up a label and go back to that label whenever you like without losing anything.
As for eclipse, you probably didn't zip some hidden files or something.
In addition, I remember having some similar problem, I had to resync the files with the project, try this one
Good Luck
我对我的项目也做了同样的事情。我发现从 Eclipse 中复制整个项目(右键单击资源管理器窗口窗格中的项目,单击“复制”,然后单击项目外部并单击“粘贴”)效果很好,而不是通过 Windows 资源管理器来复制文件。粘贴时,您可以指定新的保存位置和项目名称,这可以是您的备份空间。然后你可以在项目的版本之间切换没有问题。
I do the same thing with my projects. Instead of going through windows explorer to copy the files, I find copying the entire project from within Eclipse (right click the project in the explorer window pane, click copy, then click outside of the project and click paste) works just fine. When you paste it, you can specify a new save location and project name, which can be your backup space. Then you can switch between versions of the project no problem.