复制Android项目文件夹不是一个完整的备份? [英] Copying an Android Project Folder is Not a FULL Backup?

查看:220
本文介绍了复制Android项目文件夹不是一个完整的备份?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几周前,我通过将整个文件夹(Windows 7)复制到网络共享中,拍摄了我的Android项目的快照。

Several weeks ago I took a snapshot of my Android project by simply copying the entire folder (Windows 7) to a network share.

几周后,我想要在新的(和不同的)工作区中构建该快照。所以我:

A few weeks later, I wanted to build that snapshot in a new (and different) workspace. So I:



  1. 工作区创建一个空文件夹,

  2. 切换Eclipse然后,

  3. 然后使用文件>导入。 ..
    的快照复制到工作空间。

  1. Created an empty folder for the workspace,
  2. Switched Eclipse to it,
  3. Then used File > Import... to copy that snapshot to the workspace.

我很惊讶地发现项目 - 在我将其复制到网络共享之前不存在的错误。

I was then surprised to find errors in the project - errors that weren't there before I copied it over to the network share.

第一个症状是项目中最后一个文件有多个错误。我通过输入Eclipse(再次!)来修复Android的SDK位置:

The first symptom was that only the last file in the project had multiple errors. I "fixed" that by entering into Eclipse (again!) Android's SDK location:

Windows>首选项> Android> SDK位置:C:\android-sdk-windows

这导致许多文件现在有错误,在控制台上提供以下提示:

This resulted in numerous files now having errors, with the following hint at the console:

Android要求.class兼容性设置为5.0。请修改项目属性。

我通过将鼠标悬停在 @override 并选择将工作空间合规性更改为JRE至1.5 气球建议。这很奇怪,因为我检查了 Windows>首选项> Java>编译器>编译器合规性级别:,之前是1.6以前 - 1.6是否包含1.5?

I fixed that by hovering over @override and selecting the Change workspace compliance and JRE to 1.5 balloon suggestion. This is strange because I checked Windows > Preferences > Java > Compiler > Compiler compliance level: and it was 1.6 before - Doesn't 1.6 include 1.5?

然后我只剩下两个错误, code> @Override s,这不应该在那里(实现接口的方法)。所以我删除了他们,现在一切都很好,项目的建立和运行完美如前。

I was then left with only two errors stemming from @Overrides that shouldn't really be there (for methods implementing interface). So I removed them and now all is fine and the project builds and runs perfectly as before.

所有好的和花花公子,但我非常惊讶的事实,我其实有在Eclipse中更改任何 ,更不用说我最终最终修改了原始源代码(仅删除 @override ),以使其构建 - 几周前没有任何投诉的源代码!

All nice and dandy but I was very surprised by the fact that I actually had to change anything in Eclipse, not to mention that I eventually ended up modifying the original source code (deleting @overrides only) to get it build - source code that had no complaints whatsoever weeks ago!

什么可能解释这个?不是将Android项目文件夹复制到真正的完整备份?

What could possibly explain this? Isn't copying an Android project folder a true full backup?

由于这个发现,我检查了工作区文件夹,使用了我的爱人Emacs,并发现有一个隐藏的子目录命名为 .metadata 。这可能是秘密所在。

Being baffled by this discovery, I examined the workspace folder, using my beloved Emacs, and discovered that there is a hidden subdirectory named .metadata. This is probably where the secret lies.

我现在的问题是:


  1. Eclipse存储额外的
    关于工作空间
    的其他信息?

  2. 什么是一个很好的方法来使
    Android项目更独立,
    为在完全备份?

  3. 有没有使用
    .metadata / .log 文件?我可以安全地
    删除吗?

  1. Does Eclipse store additional information about the workspace elsewhere?
  2. What is a good approach to make Android projects more independent, as in "fully backup-able"?
  3. Is there any use for the .metadata/.log file? Can I safely delete it?


推荐答案

一个专案。如果我正在记住,帮助右键单击项目名称并选择Android工具 - >修复项目属性...

I had those errors too when imported a project. If I'm remembering correctly, helped right-clicking in project name and selecting Android Tools -> Fix project properties...

之后错误消失。


Android要求.class兼容性
设置为5.0。请修复项目
属性。这是什么?这是在克隆
资源库并尝试将
导入Eclipse之后收到的
错误。有相当的
关于这个的
的一些信息,
夫妇关于邮件列表
的讨论,但我想我会写一个
的文章解决这个。

"Android requires .class compatibility set to 5.0. Please fix project properties." What’s this? It’s the error I received after cloning a repository and trying to import it into Eclipse. There is reasonably little information online about this, couple discussions on mailing lists but I figured I would write a post on the solution to this.

将项目导入
工作区后,您收到错误。
所以你需要做的是
右键点击项目 - > Android
工具 - >修复项目属性。现在
这个单独不会解决问题,你
需要重启Eclipse之后。
此后,再次尝试构建项目
,并且此时应该成功运行
(除非您在
代码本身中有错误,否则)。

After importing the project to your workspace, you’ve received the error. So what you need to do next is to right click on the project -> Android Tools -> Fix Project Properties. Now this alone won’t fix the problem, you need to restart Eclipse after this. After that try building the project again and it should work successfully this time (unless you have bugs in the code itself, I did).

这篇关于复制Android项目文件夹不是一个完整的备份?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆