将现有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
Run Code Online (Sandbox Code Playgroud)
导入项目(并执行NOTHING else)后,文件如下所示:
# 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
Run Code Online (Sandbox Code Playgroud)
清单有以下几项:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14"/>
Run Code Online (Sandbox Code Playgroud)
这意味着每次有人导入项目时,我们都必须在project-> properties-> android菜单中重置构建目标.我安装了最新的ADT工具,所有SDK都已下载并可用.
我试过的事情:
我刚刚确认我可以在导入后"修复"项目.从Eclipse中删除项目,但将内容保留在磁盘上.导入项目错误地再次编辑project.properties.导入过程无法识别project.properties中的Google API条目.
这就是我将项目从文件系统导入Eclipse的方式:

思考?
小智 -1
像您正在做的那样导入您的项目 ie
将现有的 Android 代码放入工作区。
现在删除project.properties。清理并构建项目。
如果现有项目有 build.xml 文件,则使用此 ant 构建文件导入选项导入项目
新建-->其他-->现有 Ant 文件中的 Java 项目-->
按照进一步的选项,你就完成了
右键单击您的项目 ---> 项目属性转到 Android 选择适当的 API 级别。清理并构建您的项目......现在已经完成
| 归档时间: |
|
| 查看次数: |
10793 次 |
| 最近记录: |