【发布时间】:2013-04-30 13:57:43
【问题描述】:
将现有 Android 项目导入 Eclipse 时,project.properties 更新不正确。此文件存在于源代码管理中:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=Google Inc.:Google APIs:14
导入项目后(不做其他任何事情),文件如下所示:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
清单有以下项目:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14"/>
这意味着每次有人导入项目时,我们都必须在 project->properties->android 菜单中重置构建目标。我安装了最新的 ADT 工具,所有 SDK 都已下载并可用。
我尝试过的事情:
- 删除整个项目,包括磁盘上的内容,在导入前克隆和删除 project.properties 文件。结果相同。
- 在导入前删除整个项目,包括磁盘上的内容、克隆和删除 .settings 文件夹。结果相同。
- 删除整个项目,包括磁盘上的内容,克隆和导入只是为了笑。结果相同。
- 遍历 .project 文件。没什么有趣的。
- 仔细检查了 ant.properties、build.xml 和所有其他纯文本可读文件中的线索。没什么有趣的。
- 用谷歌搜索问题并仔细检查 Eclipse 和 ADT 错误站点是否存在已知问题。纳达。
- 在文件系统上验证文件确实在克隆后具有正确的设置,并且导入是罪魁祸首。
- 删除整个项目,包括磁盘上的内容,克隆,手动编辑 project.properties 文件到 android-14,导入。这导致 project.properties 文件未更改,但由于我使用 Google API 进行映射,这是不可接受的。
我刚刚验证我可以在导入项目后“修复”项目。从 Eclipse 中删除项目,但将内容保留在磁盘上。导入项目不正确会再次编辑 project.properties。导入过程无法识别 project.properties 中的 Google API 条目。
这就是我将项目从文件系统导入 Eclipse 的方式:
想法?
【问题讨论】:
-
我通过stackoverflow做了一点浏览,发现有两种方法可以导入现有项目。也许如果您尝试通过以下方式将其导入:import>General>Existing Project into Workspace,它不会进行这种奇怪的更改。只是一个想法。
-
这会丢失 Android 包结构。我提交了一个错误报告:code.google.com/p/android/issues/detail?id=54828
-
嗨,比尔。我有同样的问题。你找到解决办法了吗?
-
@RajatAnantharam 我没有。